Skip to content

Commit

Permalink
test if path exist with ghost clicks events (#4703)
Browse files Browse the repository at this point in the history
  • Loading branch information
eskan authored and dfreedm committed Dec 21, 2017
1 parent bd1792a commit 7b6ff53
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/standard/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@
// disable "ghost clicks"
if (mouseEvent.type === 'click') {
var path = Polymer.dom(mouseEvent).path;
for (var i = 0; i < path.length; i++) {
if (path[i] === POINTERSTATE.mouse.target) {
return;
if (path) {
for (var i = 0; i < path.length; i++) {
if (path[i] === POINTERSTATE.mouse.target) {
return;
}
}
}
mouseEvent.preventDefault();
Expand Down

0 comments on commit 7b6ff53

Please sign in to comment.