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 hold left behind a smooth scroll command is not written when the command ends (WebKit wheel hold) #1406
Follow-up from #1400 (merged in d40d8c8), where this came up in review and was left out on purpose.
What happens
In WebKit, corrections are held for 150ms after a wheel event (#1400). If that hold is created while a smooth scroll command is travelling, nothing writes it when the command ends:
scrollToIndex(0, { behavior: 'smooth' })
a wheel event while it travels
a prepend inside the 150ms window, so the anchor delta is held (say 600px)
the wheel timer ends, but _flushHoldIfReady waits because the phase is still smooth
the element reaches 0, the layout is still at 600, and the command never sees its target
After the 5s safety valve the command is dropped and the hold is still pending. The list sits on the old first row, 600px short of row 0, until the next wheel event, scroll or render. Without the wheel event in step 2 the same sequence lands on row 0.
The obvious fix is to release any pending hold when a command starts or ends. That also changes the iOS touch hold and the bounce hold, 23 scroll-trace snapshots move. So it needs its own look at what a command should do with a hold that isn't from the wheel.
Notes
Only seen in the unit test harness so far, not in a browser. A real wheel during a smooth scroll may cancel the animation first, which would make it harder to hit.
Activity
fix(virtual-core): re-aim any smooth command when the wheel hold ends
test: cover the wheel hold behind a smooth command in WebKit