Skip to content

Commit

Permalink
skip initial round moves scroll(s) on unplayed game page load
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 21, 2025
1 parent 9627a99 commit a5874f4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/round/src/view/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ export function render(ctrl: RoundController): LooseVNode {
}
});
ctrl.autoScroll = () => autoScroll(el, ctrl);
ctrl.autoScroll();
if (isCol1()) ctrl.autoScroll();
/* On a phone, the first `autoScroll()` sometimes doesn't fully show the current move. It's possible this
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 a5874f4

Please sign in to comment.