Closed
Bug 1016480
Opened 10 years ago
Closed 8 years ago
preventing default action of touchend event should cancel synthetic click event
Categories
(Firefox for Android Graveyard :: Toolbar, defect)
Tracking
(fennec+)
VERIFIED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
fennec | + | --- |
People
(Reporter: miketaylr, Unassigned)
References
Details
(Keywords: dev-doc-needed)
Attachments
(1 file)
5.00 KB,
text/html
|
Details |
Currently calling preventDefault() on a touchend event does not cancel the synthetic click event that comes after. We should add that for compatibility with current Chrome Mobile and iOS Safari. This breaks sharing videos on Vimeo.com and playback for tablet users (also on vimeo).
Comment 1•10 years ago
|
||
Is this specced anywhere? AFAIK preventDefault() is only respected on touchstart and the first touchmove event.
OS: Mac OS X → Android
Hardware: x86 → ARM
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #1) > Is this specced anywhere? AFAIK preventDefault() is only respected on > touchstart and the first touchmove event. My read on "touchend" at <http://www.w3.org/TR/touch-events/#list-of-touchevent-types> is that it is cancelable and the default action is (or can be) a click.
Comment 3•10 years ago
|
||
Matt, do you agree that prevent default action on a touchend should prevent clicks? Does that mean we have to insert another 300ms delay before the click?
Flags: needinfo?(mbrubeck)
Comment 4•10 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3) > Matt, do you agree that prevent default action on a touchend should prevent > clicks? If the research in bug 966919 comment 20 is correct that current versions of Chrome and Safari prevent clicks when touchend is canceled, then definitely yes. > Does that mean we have to insert another 300ms delay before the click? Hmm, good question. I think we can avoid that, if we're careful. We should be able to dispatch the simulated click events (or not) as soon as any "touchend" listeners have finished executing, which we can know synchronously in the content process. So for example the content process could just ignore a "singletap" message if the preceding touchend event was canceled, as long as those messages are sent in that order (touchend before singletap).
Flags: needinfo?(mbrubeck)
Comment 5•10 years ago
|
||
Ok, thanks. That makes sense.
Updated•10 years ago
|
tracking-fennec: ? → +
Comment 6•10 years ago
|
||
(In reply to Richard Maher from bug 776030 comment #8) > Related to 978438 and FWIW: - > > I think it is important for the accompanying documentation to point out > that, when trying to disable default mouse event emulation from touch > events, event.preventDefault() should ONLY be called from the touchend > event. Otherwise any touchcancel or touchleave events are just not gonna > happen. > > To me https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events > lacks clarity on this.
Keywords: dev-doc-needed
Updated•10 years ago
|
Priority: P5 → --
Comment 9•8 years ago
|
||
Now that we are using APZ in Fennec this should be fixed. I tried the attached test case but it's not clear to me from reading the code how the behaviour of the test case would be different with and without this bug, because I didn't see a click handler on the share button.
Status: NEW → RESOLVED
Closed: 8 years ago
Depends on: fennec-aboard-apz
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Reporter | ||
Comment 10•8 years ago
|
||
> I tried the attached test case but it's not clear to me from reading the code how the behaviour of the test case would be different with and without this bug, because I didn't see a click handler on the share button
IIRC, this was more about the synthetic click being dispatched on content that appears later (with its own click handler). That said, I can confirm this is no longer an issue in 48.
Status: RESOLVED → VERIFIED
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•