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

[Accessibility] - 'Tap' does not fire when clicked #803

Closed
leifdejong opened this issue Jun 8, 2015 · 7 comments
Closed

[Accessibility] - 'Tap' does not fire when clicked #803

leifdejong opened this issue Jun 8, 2015 · 7 comments
Labels

Comments

@leifdejong
Copy link

In Voice Over (VO) on iOS devices, 'Tap' is never fired.

Replication:

  1. Bind an element to 'tap'
  2. Turn on Voice Over
  3. Double tap to 'click'

Expected:

  1. Event handler should fire

VO does a click and somewhere, that event gets lost in Hammer. The workaround was to bind both events (click, tap) and then throw 'click' away if 'tap' is recognized. If tap is not found, it goes ahead and fires the click event.

Solution:

My recommendation for Hammer would be to bind the click when the 'tap' is bound and do some checks internally. This is the only way as we can know when voiceover is being used. Will be working on a fix.

@leifdejong leifdejong changed the title Accessibility - 'Tap' does not fire when Clicked [Accessibility] - 'Tap' does not fire when clicked Jun 8, 2015
@arschmitz arschmitz added the bug label Jun 8, 2015
@arschmitz
Copy link
Contributor

@leifdejong Thank you for reporting this i will look into this.

Im a little unsure on what the semantics should be here though as tap and click are different this is equivalent in some ways to expecting tap to fire if a jQuery plugin did .trigger( "click" ) or even a native .click() this would never cause a tap event. There are many situations where a click can happen with out an accompanying up / down events is it expected behavior that all of these should trigger a simulated tap event?

I'm interested to hear what others think about this? @jtangelder

@leifdejong
Copy link
Author

Yap. Had a similar issue when binding 'tap' to an element in a UI plugin and then having a MVC* framework (in our case Backbone) bind a click on that same element, the click is never picked up. Thats why I think that the click event should always be triggered in some controlled way.

This was my hack. Its ugly!

var $el = $('body');
$el.on('tap click', eventHandler.bind(this));

function eventHandler(event) {
  if (event.isFinal) {
    action();
    event.stopImmediatePropagation();
    event.preventDefault();
  } else {
    action();
  }
} 

Please note this solution only works on Device. Its screwy on Desktop hens looking to help find a better solution.

@arschmitz
Copy link
Contributor

@leifdejong so we have been discussing this on slack and we definitely want to try to tackle this problem as it 100% is a real problem. On jQuery mobile we have had multiple similar issues filed with our own tap event.

What we are not sure is if we should fix this in hammer proper or take a more modular approach and just provide the needed hooks and develop an add on module to handle this.

@leifdejong
Copy link
Author

@arschmitz any way that I can be involved? I can devote some time to hacking something up.

@arschmitz
Copy link
Contributor

@leifdejong absolutely we are looking for team members see #800 and join us on slack at https://hammerjs.herokuapp.com/

Edited by @runspired to fix link

@runspired
Copy link
Contributor

@arschmitz this issue is another manifestation of the breakdown of tap vs click. Since these sorts of clicks never fire pointer events at all, tap handlers don't execute.

It's a driving motivation behind the new approach here: runspired/ember-mobiletouch#56

Do you know if PEP handles these sorts of cases?

@arschmitz
Copy link
Contributor

this is the same thing as #808 closing in favor of that this is another tap as a fast click issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants