Skip to content

Commit

Permalink
Merge pull request #4638 from CasperTech/master
Browse files Browse the repository at this point in the history
Prevent click events from firing twice on Windows Phone
  • Loading branch information
mlynch committed Dec 6, 2015
2 parents 118ba8a + a538035 commit 38a9157
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 38a9157

Please sign in to comment.