Skip to content

Commit

Permalink
Merge pull request lichess-org#16820 from johndoknjas/fully-show-nota…
Browse files Browse the repository at this point in the history
…tion-on-refresh

Don't obscure notation when refreshing on a phone
  • Loading branch information
ornicar authored Jan 21, 2025
2 parents 832f627 + a5874f4 commit 2ab6257
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/round/src/view/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ export function render(ctrl: RoundController): LooseVNode {
}
});
ctrl.autoScroll = () => autoScroll(el, ctrl);
ctrl.autoScroll();
if (ctrl.ply > 2) {
ctrl.autoScroll();
if (isCol1()) ctrl.autoScroll();
/* On a phone, the first `autoScroll()` sometimes doesn't fully show the current move. It's possible this
is due to some needed data not loading in time. The second `autoScroll()` fixes the issue, since the throttle
ensures a min wait of 100ms. */
}
}),
},
renderMoves(ctrl),
Expand Down

0 comments on commit 2ab6257

Please sign in to comment.