NEW 184251
touchmove bound to the document during a touchstart listener is not cancelable (default cannot be prevented)
https://bugs.webkit.org/show_bug.cgi?id=184251
Summary touchmove bound to the document during a touchstart listener is not cancelabl...
Anand Thakker
Reported 2018-04-02 17:48:24 PDT
Tested on: iOS 11.2.6, 11.3 Steps to reproduce: 1. Create a script that: - Adds a `touchstart` listener, `onStart`, to some div `myDiv`. - In `onStart`, add a `touchmove` listener, `onMove`, (with `{passive: false}`) to `document`. - In `onMove(e)`, call `e.preventDefault()`. 2. Load the page in iOS 11.2.6 or 11.3 and attempt a scroll from within `myDiv`. Expected result: the page does not scroll. Actual result: the page scrolls. Self-contained example: https://gist.github.com/anandthakker/2d0e71924285a845f0c4e6c5fd966234
Attachments
Testcase (from GitHub with DOCTYPE) (2.47 KB, text/html)
2022-09-12 14:51 PDT, Ahmad Saleem
no flags
Anand Thakker
Comment 1 2018-04-02 17:59:07 PDT
It's worth noting that this issue arises amidst an attempt to mitigate the breaking change discussed in https://bugs.webkit.org/show_bug.cgi?id=182521.
Radar WebKit Bug Importer
Comment 2 2018-04-03 10:26:59 PDT
Toby Rahilly
Comment 3 2018-07-18 23:43:27 PDT
Experiencing the same issue on iOS 11.4.1 Full user agent: Mozilla/5.0 (iPad; CPU OS 11_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1 Two workarounds: 1) Register a passive event listener on any non-window/document/body element that the event will bubble though. 2) Register the touchmove event listener outside of the touchstart.
Simon Fraser (smfr)
Comment 4 2018-07-19 08:40:04 PDT
3) register the listener with { passive: false }
Toby Rahilly
Comment 5 2018-07-19 08:44:41 PDT
Hi Simon, the touchmove listener is registered with { passive: false } but unfortunately still experiences the behaviour described in this bug.
Toby Rahilly
Comment 6 2018-07-19 18:10:39 PDT
I also tried registering the touchstart event with {passive: false}, but it didn't fix the problem.
Lucas Forschler
Comment 7 2019-02-06 09:19:11 PST
Mass move bugs into the DOM component.
Ahmad Saleem
Comment 8 2022-09-12 14:51:13 PDT
Created attachment 462297 [details] Testcase (from GitHub with DOCTYPE)
Ahmad Saleem
Comment 9 2022-09-12 14:53:15 PDT
I am not able to reproduce this bug in Safari 16 on iPhone 13 Pro Max (iOS 16) and not able to scroll the page from the body in light green hue area. Appreciate if someone else can confirm as well because I am not too sure on my testing with this test case. Thanks!
David
Comment 10 2023-05-04 12:55:21 PDT
Experiencing the same problem on iOS 16.4.1. If I try to scroll the page on the light green area, the page scrolls but only sometimes. It’s inconsistent in other words. The easiest way for me to reproduce the bug was to repeatedly do swipe gestures in one direction inside the green area. Eventually, one of the swipe gestures will scroll the page even though it shouldn’t.
Note You need to log in before you can comment on or make changes to this bug.