Hi,
Quick query; Is the tap event meant to fire the click event on desktops as well? As this throws a spanner in the works for my following scenario:
$( document ).on( 'dblclick', '#btn', function( ev )
{
// Fire My Logic Off
});
$( document ).on( 'tap', '#btn', function( ev )
{
$( this ).trigger( 'dblclick' );
});
What I expect:
Desktop - Single click event does nothing or other separate event stuff.
Desktop - Double click event to fire the element's logic off.
Touch phones - Single tap to fire the double click event and thus fire the element's logic off.
What actually happens:
Desktop - Single click fires the tap event which fires my double click logic. Incorrect
Desktop - Double click too late as Single click has fired.
Touch phones - Single tap fires the double click and thus fires the element's logic off. Correct
So basically my logic fires a click early. This happens in Webkit & FF (not IE11). I've tried various ev.preventDefault(); combinations as well to no avail.
Hi, Quick query; Is the
tap
event meant to fire theclick
event on desktops as well? As this throws a spanner in the works for my following scenario:What I expect:
Single click
event does nothing or other separate event stuff.Double click
event to fire the element's logic off.Single tap
to fire thedouble click
event and thus fire the element's logic off.What actually happens:
Single click
fires thetap
event which fires mydouble click
logic. IncorrectDouble click
too late asSingle click
has fired.Single tap
fires thedouble click
and thus fires the element's logic off. CorrectSo basically my logic fires a click early. This happens in Webkit & FF (not IE11). I've tried various
ev.preventDefault();
combinations as well to no avail.http://jsfiddle.net/3cd9wz54/ Shows the
tap
&click
being fired.Could you shed some light on the situation please?
Regards,
Paul