jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

tap events never triggered on mobile devices #8597

Closed neoacevedo closed 7 years ago

neoacevedo commented 7 years ago

I am developing an hybrid app.

The click event works ok, but (according with apache cordova) it event "raise" a lag of ~300ms (but I do not notice it) so they encourage the use of tap event.

Now, changing click to tap gets on an issue: tap event never is fired.

I am developing on Apache Cordova 6.3.1 with jQuery 3.2.1 and jQuery Mobile 1.4.5

This is my code: $("#siguiente").on('tap', function (event) { event.preventDefault(); event.stopPropagation(); alert('tap'); });

When I touch the button the event never is fired, but if I change on('tap', ... for .click(function()... the click event is fired.

apsdehal commented 7 years ago

@NestorAcevedo Can you create a fiddle for your issue so I can reproduce it? See CONTRIBUTING.md

neoacevedo commented 7 years ago

https://jsfiddle.net/ce0g1hs9/1/

But I was testing and no events are fired on jsfiddle. It gets the following error: a.event.props is undefined in firefox Cannot read property 'concat' of undefined in Chrome

So my presumption is about that error.

neoacevedo commented 7 years ago

According with https://github.com/jquery/jquery-mobile/issues/8546#issuecomment-271163317 and https://github.com/jquery/jquery-mobile/issues/8484#issuecomment-234382449 jQuey Mobile is compatible with jQuery 3.x but no one 3.x versions worked with my issue so I downloaded and used jQuery 2.2.4 in my mobile app and tap event runs so jQuery Mobile is not totally compatible with jQuery 3.x

I will hope JM 1.5 can be compatible 100% with jQuery 3.x so meanwhile I will continue using jQuery 2.2.4 and JM 1.4.5

apsdehal commented 7 years ago

Yes, the versions previous to 1.5 are not compatible with jQuery 3.x. And yes, jQM 1.5 will be compatible with jQuery 3.x. Closing as resolved for now. If you face similar issue again, feel free to comment.