Bug 253056

Summary: [css-scroll-snap] Tap before scroll has settled causes scrolling to revert to the previous snap point
Product: WebKit Reporter: Johannes Odland <johannes.odland>
Component: ScrollingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: augus.dupin, nmouchtaris, simon.fraser, webkit-bug-importer, zouhir
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
See Also: https://bugs.webkit.org/show_bug.cgi?id=251003
https://bugs.webkit.org/show_bug.cgi?id=245722
Attachments:
Description Flags
A screen recording of the bug. The user taps the screen before the scroll has settled, and the browser scrolls back to the previous snap point.
none
Screen recording of issue on iOS 16.5: tapping multiple times before scroll has landed causes the page to scroll a small amount none

Description Johannes Odland 2023-02-27 22:08:58 PST
Created attachment 465214 [details]
A screen recording of the bug. The user taps the screen before the scroll has settled, and the browser scrolls back to the previous snap point.

How to reproduse: 
1. Open a page with scroll-snap on :root/html (I.e. this codepen in debug mode: https://codepen.io/johannesodland/pen/poORgOr)
2. Scroll down
3. Tap the screen before the scroll has settled

Expected result: 
The tap should be registered as a normal click. This happens on desktop Safari, in other browsers and when scrolling a scroll-container with scroll-snap.

Actual result: 
The current snapping is interrupted, and the browser snaps back to the previous snap-point.
Comment 1 Johannes Odland 2023-02-27 22:20:44 PST
One more thing: The click is not propagated to event-handlers, preventing the page from reacting to clicks before the scroll has settled completely.
Comment 2 Simon Fraser (smfr) 2023-02-28 14:21:47 PST
*** Bug 253110 has been marked as a duplicate of this bug. ***
Comment 3 Radar WebKit Bug Importer 2023-03-06 22:09:14 PST
<rdar://problem/106346034>
Comment 4 Johannes Odland 2023-03-27 22:44:57 PDT
I have retested on iOS 16.4 and the bug still persists. 

I moved the test case to a new location for easier testing: https://johannesodland.github.io/browserbugs/safari-scroll-snap-click-during-scroll-issue.html
Comment 5 Johannes Odland 2023-05-22 04:13:37 PDT
Created attachment 466445 [details]
Screen recording of issue on iOS 16.5: tapping multiple times before scroll has landed causes the page to scroll a small amount

Retested on iOS Safari 16.5

The bug seems to be partially fixed. Tapping the screen once before the scroll has settled seems to work ok now. 

Unfortunately, tapping the screen multiple times before scroll has settled can cause the page to scroll a small amount up or down. 
When this happens the scroll does not snap to a snap point. Attaching a screen recording of the issue.