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

Tap firing twice #727

Closed
MadhuSudhanBhaskar opened this issue Nov 25, 2014 · 9 comments
Closed

Tap firing twice #727

MadhuSudhanBhaskar opened this issue Nov 25, 2014 · 9 comments

Comments

@MadhuSudhanBhaskar
Copy link

I am using Angularjs, for events I am using hammer.js . I have a new version on hammer.js on my application. The tap is binded my directive, when I tap or touch on my mobile device its firing twice.

@RyanMullins
Copy link

@MadhuSudhanBhaskar I'm the maintainer of Angular Hammer and have been encountering a similar problem. When you get a chance, take a look at my issue (#742) , which details what we believe to be the problem, and compare with your own code/experience. If you find it to be the same I would recommend closing this issue and watching my issue.

@runspired
Copy link
Contributor

@RyanMullins Did you miss the part of the docs that suggests preventGhostClicks?

http://hammerjs.github.io/tips/

https://gist.github.com/jtangelder/361052976f044200ea17

@RyanMullins
Copy link

Nope. Please read the details of my issue. It's a very different problem related to capturing both TouchEvents and MouseEvents fired from a single click but milliseconds apart.

@RyanMullins
Copy link

@runspired Unless I'm completely misinterpreting the point of PreventGhostClicks, which I view as a way to stop other handlers from being fired when after a Hammer handler responds.

@RyanMullins
Copy link

@runspired this may even be a problem particular to Angular. If it is, it's because of the Angular execution context where it effectively adds a second run loop inside of the JavaScript run loop, so it could be that the secondary mouseup event is being triggered before the PreventGhostClicks functionality in the Angular context has a chance to respond. If that is the case, then the solution I want will eliminate the need for PreventGhostClicks.

@runspired
Copy link
Contributor

@RyanMullins I think you are misinterpreting PreventGhostClicks, but I agree it should be bundled with Hammer and used by default. Basically, mobile browsers try to pretend that they are normal browsers, so they fire a "click" event a short delay after a "touchEnd". This is great for sites that haven't optimized for mobile, but for sites that do use touchEnd to determine taps/clicks, the extra click event needs to be captured and discarded, otherwise both the touchEnd and the click event will trigger a tap.

@RyanMullins
Copy link

Sounds like I know what I'm working on tomorrow afternoon then.

@MadhuSudhanBhaskar
Copy link
Author

@ryan Sure I will check your issue and close mine.
On 08-Jan-2015 3:53 am, "Ryan S Mullins" [email protected] wrote:

Sounds like I know what I'm working on tomorrow afternoon then.


Reply to this email directly or view it on GitHub
#727 (comment).

@runspired
Copy link
Contributor

Closing in favor of the meta issues for this.

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

No branches or pull requests

3 participants