Skip to content

Commit

Permalink
POC for removing gray overlays on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed May 18, 2015
1 parent 538db4e commit 078f358
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/standard/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
var MOUSE_TIMEOUT = 500;
var MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click'];

// Check for iOS safari
var IS_IOS = navigator.userAgent.match(/iP(?:[oa]d|hone)/);

// touch will make synthetic mouse events
// `preventDefault` on touchend will cancel them,
// but this breaks `<input>` focus and link clicks
Expand Down Expand Up @@ -207,6 +210,10 @@
}
for (var i = 0, dep, gd; i < deps.length; i++) {
dep = deps[i];
// don't add mouse handlers on iOS because they cause gray selection overlays
if (IS_IOS && MOUSE_EVENTS.indexOf(dep) > -1) {
continue;
}
gd = gobj[dep];
if (!gd) {
gobj[dep] = gd = {};
Expand Down

0 comments on commit 078f358

Please sign in to comment.