jIsles
jIsles

Reputation: 33

touchstart event Chrome Android issue

I have a touchstart eventlistener attached to a button and when I touch it on Android Firefox, it fires normally. On Chrome (Android) though, it won't fire at all. Any reasons why? Changing to event to click obviously works, but I need touch.

JsFiddle (works with mobile)

Upvotes: 0

Views: 1360

Answers (1)

jIsles
jIsles

Reputation: 33

I may have found the answer.. I don't know why, but it seems to work if I add e.preventDefault() to touchstart event.

I'm just adding a double click functionality for mouse and single click functionality for touch on my element, that is why I need to register both click and touch events.

By preventing default behaviour I seem to be able to simulate the 300ms click delay that mobile browsers used to have (as far as I know).

Upvotes: 1

Related Questions