Bug 163207
Summary: | touchmove event can't be default prevented | ||
---|---|---|---|
Product: | WebKit | Reporter: | vpusher <florian.maffini> |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Major | CC: | bdakin, cdumez, simon.fraser, thorton |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 10 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 10 | ||
URL: | http://codepen.io/anon/pen/PGRxOv |
vpusher
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Simon Fraser (smfr)
I think this is <rdar://problem/28479522>
Chris Dumez
This is <rdar://problem/28693432>.
Chris Dumez
(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
(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
Fixed in 10.3. Thank you.
Simon Fraser (smfr)
This was fixed in internal code, and a test added in https://trac.webkit.org/changeset/210516/.