RESOLVED FIXED 163207
touchmove event can't be default prevented
https://bugs.webkit.org/show_bug.cgi?id=163207
Summary touchmove event can't be default prevented
vpusher
Reported 2016-10-10 06:23:37 PDT
On Safari 10, by defining a simple listener that prevents default a 'touchmove' event within a scrollable element, the event is not prevent defaulted as it does with Safari 9. The behavior between Safari 9 and Safari 10 diverges. It seems to be a regression. This is reproducible here: http://codepen.io/anon/pen/PGRxOv Probably a webkit issue. Steps to Reproduce: 1. Take an element with scrollable content (overflow: scroll). 2. Add an event listener on it for "touchmouve" event, and call `event.preventDefault()` in that event listener. Expected Results: The element should not be scrollable. To try to scroll on the related element should do nothing at all. Actual Results: The element is still scrollable on Safari 10. Version: iOS 10.0.2
Attachments
Simon Fraser (smfr)
Comment 1 2016-10-13 11:38:39 PDT
I think this is <rdar://problem/28479522>
Chris Dumez
Comment 2 2016-10-13 11:54:24 PDT
Chris Dumez
Comment 3 2016-10-13 11:55:46 PDT
(In reply to comment #2) > This is <rdar://problem/28693432>. I investigated it yesterday and believe I found a workaround that Web authors can adopt until we fix this: http://codepen.io/anon/pen/QKxpPg You basically need to listen for the "touchforcechange" event and call preventDefault() on this one as well.
Chris Dumez
Comment 4 2016-10-13 11:58:03 PDT
(In reply to comment #3) > (In reply to comment #2) > > This is <rdar://problem/28693432>. > > I investigated it yesterday and believe I found a workaround that Web > authors can adopt until we fix this: > http://codepen.io/anon/pen/QKxpPg > > You basically need to listen for the "touchforcechange" event and call > preventDefault() on this one as well. I think the fix is likely to return false early in ScrollAnimatorIOS::handleTouchEvent() if the touch event is a TouchForceChange but I am not an expert in the area.
vpusher
Comment 5 2017-03-29 06:45:56 PDT
Fixed in 10.3. Thank you.
Simon Fraser (smfr)
Comment 6 2017-03-29 07:33:40 PDT
This was fixed in internal code, and a test added in https://trac.webkit.org/changeset/210516/.
Note You need to log in before you can comment on or make changes to this bug.