Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Touch: Remove touch-action-delay support
Browse files Browse the repository at this point in the history
Closes gh-316
  • Loading branch information
bethge committed Sep 27, 2016
1 parent 35d17d8 commit 6ca690f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/touch-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function selector(v) {
return '[touch-action="' + v + '"]';
}
function rule(v) {
return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; touch-action-delay: none; }';
return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; }';
}
var attrib2css = [
'none',
Expand Down
27 changes: 5 additions & 22 deletions src/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ var CLICK_COUNT_TIMEOUT = 200;
var ATTRIB = 'touch-action';
var INSTALLER;

// The presence of touch event handlers blocks scrolling, and so we must be careful to
// avoid adding handlers unnecessarily. Chrome plans to add a touch-action-delay property
// (crbug.com/329559) to address this, and once we have that we can opt-in to a simpler
// handler registration mechanism. Rather than try to predict how exactly to opt-in to
// that we'll just leave this disabled until there is a build of Chrome to test.
var HAS_TOUCH_ACTION_DELAY = false;

// handler block for native touch events
var touchEvents = {
events: [
Expand All @@ -30,19 +23,11 @@ var touchEvents = {
'touchcancel'
],
register: function(target) {
if (HAS_TOUCH_ACTION_DELAY) {
dispatcher.listen(target, this.events);
} else {
INSTALLER.enableOnSubtree(target);
}
INSTALLER.enableOnSubtree(target);
},
unregister: function(target) {
if (HAS_TOUCH_ACTION_DELAY) {
dispatcher.unlisten(target, this.events);
} else {
unregister: function() {

// TODO(dfreedman): is it worth it to disconnect the MO?
}
// TODO(dfreedman): is it worth it to disconnect the MO?
},
elementAdded: function(el) {
var a = el.getAttribute(ATTRIB);
Expand Down Expand Up @@ -362,9 +347,7 @@ var touchEvents = {
}
};

if (!HAS_TOUCH_ACTION_DELAY) {
INSTALLER = new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,
touchEvents.elementChanged, touchEvents);
}
INSTALLER = new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,
touchEvents.elementChanged, touchEvents);

export default touchEvents;

0 comments on commit 6ca690f

Please sign in to comment.