Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fixes #12082 (ngTouch regression since 1.3) #13213

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ngTouch/directive/ngClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
// Returns true if the click should be allowed.
// Splices out the allowable region from the list after it has been used.
function checkAllowableRegions(touchCoordinates, x, y) {
if (!touchCoordinates.length) {
return true; // If not coordinates that means we do not have a ghost click so bypass the check
}

for (var i = 0; i < touchCoordinates.length; i += 2) {
if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {
touchCoordinates.splice(i, i + 2);
Expand Down Expand Up @@ -260,7 +264,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
}

if (!angular.isDefined(attr.disabled) || attr.disabled === false) {
element.triggerHandler('click', [event]);
element.triggerHandler('click', [originalEvent]);
}
}

Expand Down