mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-20 12:21:52 +00:00
Avoid triggering a 'tap' event if the event target on touchStop differs from the original touchStart target.
This commit is contained in:
parent
5617d0c8d3
commit
1a21b0581c
1 changed files with 5 additions and 1 deletions
|
|
@ -70,6 +70,7 @@ $.event.special.tap = {
|
|||
|
||||
var moved = false,
|
||||
touching = true,
|
||||
origTarget = event.target,
|
||||
origPos = [ event.pageX, event.pageY ],
|
||||
originalType,
|
||||
timer;
|
||||
|
|
@ -97,7 +98,10 @@ $.event.special.tap = {
|
|||
clearTimeout( timer );
|
||||
touching = false;
|
||||
|
||||
if ( !moved ) {
|
||||
/* ONLY trigger a 'tap' event if the start target is
|
||||
* the same as the stop target.
|
||||
*/
|
||||
if ( !moved && (origTarget == event.target)) {
|
||||
originalType = event.type;
|
||||
event.type = "tap";
|
||||
$.event.handle.call( thisObject, event );
|
||||
|
|
|
|||
Loading…
Reference in a new issue