Bug 228686

Summary: scroll-snap-stop: always behaves like scroll-snap-stop: normal when using smooth scrolling
Product: WebKit Reporter: Simon Weaver <simon>
Component: ScrollingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: augus.dupin, mrobinson, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: iPhone / iPad   
OS: iOS 14   
Attachments:
Description Flags
testcase none

Simon Weaver
Reported 2021-07-31 20:47:29 PDT
I have a horizontal image carousel with five images and five navigation buttons. The slides are each 100vw in width and positioned with scroll-snapping. I am using iOS 15 Beta 4 and I have enabled 'CSSOM View Smooth Scrolling' under Experimental WebKit Features. /* partial css */ #gallery { scroll-snap-type: x mandatory; display: flex; } .slide { scroll-snap-align: center; scroll-snap-stop: normal; min-width: 100vw; width: 100vw; } The scrolling is triggered programatically when clicking a button using: document.getElementById('gallery').scrollTo({ left: offset, behavior: 'smooth' }); // offset is x position of n'th slide If I click to go from slide 1 > slide 5 then that obviously passes over all the snap stops in between. Then what happens is Safari abruptly stops on the second slide's snap point (the first it reaches). The behavior is exactly what I would expect from: scroll-snap-stop: always This is not supposed to happen with scroll-snap-stop: normal https://www.w3.org/TR/css-scroll-snap-1/#scroll-snap-stop Demo pending. Similar bug: https://bugs.webkit.org/show_bug.cgi?id=145330 https://bugs.webkit.org/show_bug.cgi?id=223406
Attachments
testcase (1.52 KB, text/html)
2022-05-10 04:54 PDT, Bruno Stasse
no flags
Martin Robinson
Comment 1 2021-08-09 10:26:02 PDT
Hi Simon, thanks for reporting this issue! Do you have a testcase for this bug?
Radar WebKit Bug Importer
Comment 2 2021-08-09 10:26:19 PDT
Bruno Stasse
Comment 3 2022-05-10 04:54:09 PDT
Created attachment 459108 [details] testcase I don't know whether there was initially a problem or not, but there is no problem today. I made a testcase where you can see that there is no problem with smooth scrolling over items with `scroll-snap-stop: normal` or `scroll-snap-stop: always`. It scrolls smoothly to the desired position in both cases, as intended. This ticket should probably be marked as fixed.
Martin Robinson
Comment 4 2022-05-11 06:06:20 PDT
Thanks!
Note You need to log in before you can comment on or make changes to this bug.