You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
virtual-core: a wheel hold that ends in a bounce at the top still strands a smooth scroll command (WebKit) #1410
Follow-up from #1408 (fix for #1406), left out on purpose.
What happens
#1408 writes the wheel hold and aims a travelling smooth command again when the wheel hold ends. That doesn't happen when the hold ends during a bounce at the top:
scrollToIndex(0, { behavior: 'smooth' })
a wheel event while it travels, and a prepend inside the 150ms window, so the anchor delta is held (say 600px)
the element reaches the top and rubber-bands past it (scrollTop -20)
the wheel hold ends during the bounce (the 150ms timer, or the two frames at the top). _canWriteScroll() is false while overscrolled, so nothing is written, which is right, WebKit would drop the write
the bounce settles at 0. The scroll events after it call _flushHoldIfReady(true) without wheelEnded, so the flush waits for the smooth command again, and the command can't land because the layout is still 600 away
Same symptom as #1406: the command sits until the 5s safety valve, then the hold is written and the list ends 600px short of row 0. In the unit harness: during and after the bounce no writes, hold 600, phase smooth; after the valve one write of 600, row 0 at -600.
Why it matters
With a real trackpad in Safari, scrolling up into the top of a list usually bounces, so this may be the common way to hit it, more than the Playwright case #1408 covers. Not checked on a real device yet.
Possible direction
Remember that the wheel hold ended with a write still owed (a smooth command travelling and a hold pending), and pass wheelEnded on the first flush that can write after it, so the bounce settling does the re-aim. A test in wheel-hold.test.ts already pins that nothing is written during the bounce.
Activity