Skip to content

Commit

Permalink
Prevent click events from firing twice on Windows Phone (tested on 8.…
Browse files Browse the repository at this point in the history
…1 and 10).
  • Loading branch information
TomMettam committed Nov 17, 2015
1 parent d2a83ea commit bfd01a7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/utils/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ ionic.tap = {
},

requiresNativeClick: function(ele) {
if (ionic.Platform.isWindowsPhone && (ele.tagName == 'A' || ele.tagName == 'BUTTON' || ele.hasAttribute('ng-click') || (ele.tagName == 'INPUT' && (ele.type == 'button' || ele.type == 'submit')))) {
return true; //Windows Phone edge case, prevent ng-click (and similar) events from firing twice on this platform
}
if (!ele || ele.disabled || (/^(file|range)$/i).test(ele.type) || (/^(object|video)$/i).test(ele.tagName) || ionic.tap.isLabelContainingFileInput(ele)) {
return true;
}
Expand Down

0 comments on commit bfd01a7

Please sign in to comment.