Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

click events canceled on devices w/touch and mouse? #18

Closed
wkeese opened this issue Apr 14, 2014 · 7 comments
Closed

click events canceled on devices w/touch and mouse? #18

wkeese opened this issue Apr 14, 2014 · 7 comments
Assignees
Milestone

Comments

@wkeese
Copy link
Member

wkeese commented Apr 14, 2014

I might be wrong, but ISTM that mouse click events won't work on devices that support both touch and mouse (currently on Chrome on a laptop w/a touch screen). The reason is:

  1. events.js loads handlers/touch.js
  2. handlers/touch.js calls utils.js, which sets up code to cancel native clicks.
  3. note: handlers/touch.js fires synthetic click events on touchstart/touchend, but nobody fires synthetic click events on mousedown/mouseup.
  4. therefore, when the user clicks using the mouse, there will be no synthetic click, but the native click will be canceled.

This problem was addressed in dojo/dojo@bcbba40 but AFAICT it's not addressed in dpointer.

On a similar note, it seems like your current code will hide click events from using SPACE or ENTER key while focused on a <button>.

Again though, I might be misunderstanding.

@seb-pereira
Copy link
Member

You are right, native click is absorbed and there is no synthetic click in that case. I also noticed that compatibility mouse events are generated when user tap on the screen, which leads to an extra set of pointer events (pointermove > pointerdown > pointerup) after the click event.

@wkeese
Copy link
Member Author

wkeese commented Apr 14, 2014

Hmm, all these compatibility events really change the strategy. Does that mean that there's no reason to listen for touch events at all (on that platform)?

@seb-pereira
Copy link
Member

Compat mouse events are generated only before a native click event, when user tap the screen. That's all. When you touch/scroll you only gets touch events. So we need to listen to both type of events.
I am thinking of a solution to solve this. Will post a link to a document with the details.

@seb-pereira seb-pereira self-assigned this Jul 25, 2014
@seb-pereira seb-pereira added this to the 0.4.0 milestone Sep 3, 2014
@seb-pereira
Copy link
Member

click events won't work on devices that support both touch and mouse (currently on Chrome on a laptop w/a touch screen)

DPointer no more listen for touch event on Chrome Desktop (#31) until there is a clean way to differentiate compat mouse events from touch events (#32).

On a similar note, it seems like your current code will hide click events from using SPACE or ENTER key while focused on a <button>.

#31 should also fix that.

@wkeese
Copy link
Member Author

wkeese commented Sep 10, 2014

On a similar note, it seems like your current code will hide click events from using SPACE or ENTER key while focused on a <button>.

#31 should also fix that.

I thought #31 was only changing Chrome. What about (SPACE or ENTER key while focused on a <button> on) other browsers?

@seb-pereira
Copy link
Member

You are right, even with #13 there is indeed a case that may impact click event on hitting SPACE/ENTER when Touch Events are supported by the bowser.

Anyway, I am strongly considering to remove this click handler which is here only to fix a bug on Android 4.1.1. From our experience most 4.1.1 Android devices can be updated to (at least) 4.1.2 where this issue is no longer present.

If we want to keep this fix it would involve to replace the touch events feature detection in clickhandler by a test on the android version 4.1.1. I don't think it worth it.

@cjolif
Copy link
Contributor

cjolif commented Sep 11, 2014

Yes please remove any 4.1.1 specific fix if 4.1.2 is solving the issue.

@cjolif cjolif modified the milestones: 0.3.0, 0.4.0 Oct 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants