Bug 310358
| Summary: | Scrolling position cannot be altered on iOS during scroll | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Alex <alexander> |
| Component: | Scrolling | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | karlcow, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 26 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 26 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=187449 | ||
Alex
I have a case where I need to change scroll position mid-scroll and scroll needs to continue from the changed scroll position.
It works correctly on Windows with touchpad in both Chrome and Firefox
It works correctly on Mac in Chrome, Firefox and Safari
It works correctly on Android in both Chrome and Firefox
It does NOT work on iOS
On iOS when I scroll with my finger touching the screen and during this scroll action I change scrollLeft, the very next touchmove event puts the scroll back to where it would have been if I didn't change scrollLeft.
To better understand what I am talking about open this Codepen and try to slowly scroll the container. The scroll position resets every 3 seconds. In every browser and every OS you would see that once the scroll was reset – it will continue just fine from the beginning, even if you didn't let go of the screen/touchpad. On iOS it will still be one continuous scroll, the scroll position reset would flicker for a moment and be ignored after next touchmove.
https://codepen.io/waterplea/pen/bNwrgJp
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/173197596>
Simon Fraser (smfr)
Is it just the finger-down behavior that you are saying has a problem? Not the flick-scroll?
Alex
I think so. I don't know, here's what I'm trying to make, an infinite carousel:
https://codepen.io/waterplea/pen/XJjzrQW
It takes like just a dozen of LOC and it works perfectly everywhere. Except iOS, as always.
Trying to workaround it by changing styles with :active to keep IntersectionObserver from triggering, but then there's this:
https://bugs.webkit.org/show_bug.cgi?id=310540
Trying to do it by hand, but then there's this:
https://bugs.webkit.org/show_bug.cgi?id=191218
Very basic CSS does not work. Very basic JS events do not work and this is ignored for 8 years. I'm not even sure what am I doing here.