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 events on samsung galaxy devices does not fire for each tap #804

Closed
kmc059000 opened this issue Jun 10, 2015 · 11 comments
Closed

Tap events on samsung galaxy devices does not fire for each tap #804

kmc059000 opened this issue Jun 10, 2015 · 11 comments

Comments

@kmc059000
Copy link

See #683

I am having an issue with tap events on certain devices (Samsung Galaxy line). The issue is that the tap event does not fire each time I tap the element. The tap event fires roughly 10% of the time, and is completely random.

This issue exists even on the hammerjs home page, so it is not a problem with my app. On http://hammerjs.github.io/, when I tap the box, it responds to the tap maybe 10% of the time. I tried this on numerous devices.

Device OS Version Works?
Galaxy S6 5.0.2 no
Galaxy S5 5.0 no
Galaxy S4 5.0.1 no
Galaxy S3 4.4.2 no
Nexus 6 5.1.0 yes
Nexus 10 4.4.3 yes
HTC M8 5.0.2 yes
HTC M8 5.0.1 yes
iPhone 5s 8.3 yes
iPhone 6 8.1.3 yes
iPhone 6+ 8.1 yes

Based on my tests, it only seems to happen on galaxy devices (and maybe all samsungs).

It seems as though the tap exceeds the threshold option configured for a tap. To resolve this in my app, I simply set the threshold to 9 instead of 2:

window.Hammer.Tap.prototype.defaults.threshold = 9;

However, I think hammer should be changed to account for this as numerous users of hammer js use a galaxy device or samsung device (depending on which causes the issue).

I mentioned in #683 that the pan recognizer was firing, but I did not have to do anything with the pan recognizer to fix the issue in my case. Changing the threshold resolved it for me.

@Ranger2959
Copy link

I am also running into this issue. Any updates on this? Is anyone planning to fix this in the library?

@kmc059000 What devices have you seen this on? I have seen it on Samsung Galaxy S6

@arschmitz
Copy link
Contributor

@Chrisgozd we are planning on looking into this but in general its very hard to fix device specific vs bugs on a particular version of android, that said we will do our best.

@kmc059000
Copy link
Author

@Chrisgozd Galaxy 3, 4, 5, and 6 only. I didn't try it on any other samsung device (tablets) to test if it was a galaxy only issue, or samsung as a whole. We didn't see it on any other devices, but we only have so many to test on.

@runspired
Copy link
Contributor

There is a gap between tap and press in the defaults that makes a user action easy to lose. As noted above, you should adjust the default tap movement threshold. You should also adjust the tap and press timers such that there is no time difference between them. If you don't have or use press, you may want to increase the amount of time for which a tap is able to be recognized.

@arschmitz
Copy link
Contributor

@runspired It seems to me like we should probably adjust these values in the lib i agree that there should not be a gap between them

@kmc059000
Copy link
Author

One thing we did was if we knew we didn't need a true press event, we would attach to both tap and press with the same handler, and remove the gap between tap and press. We did this because we wanted events to fire for those elements regardless of how long the user pressed their finger, whether it was short or long.

This effectively is a new gesture which we called 'click', except we use tap and press together to do it. Vanilla click events in the browser do not care how long the user presses down.

@runspired
Copy link
Contributor

I do that regularly as well. @kmc059000

@arschmitz
Copy link
Contributor

@kmc059000 @runspired that sounds like another case of "missusing" hammer as a fast click ala #808

@runspired
Copy link
Contributor

Pretty much, but that's how this lib is used everywhere :trollface: :

@runspired
Copy link
Contributor

Closed in favor of #838

@lizhe2004
Copy link

Do you consider change the default value of tap event threshold ? I also meet the issue in samsung mobile devices, after we increase the value, the issue is fixed.

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

5 participants