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

Commit 6ca690f

Browse files
committed
Touch: Remove touch-action-delay support
Closes gh-316
1 parent 35d17d8 commit 6ca690f

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

src/touch-action.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function selector(v) {
55
return '[touch-action="' + v + '"]';
66
}
77
function rule(v) {
8-
return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; touch-action-delay: none; }';
8+
return '{ -ms-touch-action: ' + v + '; touch-action: ' + v + '; }';
99
}
1010
var attrib2css = [
1111
'none',

src/touch.js

+5-22
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ var CLICK_COUNT_TIMEOUT = 200;
1414
var ATTRIB = 'touch-action';
1515
var INSTALLER;
1616

17-
// The presence of touch event handlers blocks scrolling, and so we must be careful to
18-
// avoid adding handlers unnecessarily. Chrome plans to add a touch-action-delay property
19-
// (crbug.com/329559) to address this, and once we have that we can opt-in to a simpler
20-
// handler registration mechanism. Rather than try to predict how exactly to opt-in to
21-
// that we'll just leave this disabled until there is a build of Chrome to test.
22-
var HAS_TOUCH_ACTION_DELAY = false;
23-
2417
// handler block for native touch events
2518
var touchEvents = {
2619
events: [
@@ -30,19 +23,11 @@ var touchEvents = {
3023
'touchcancel'
3124
],
3225
register: function(target) {
33-
if (HAS_TOUCH_ACTION_DELAY) {
34-
dispatcher.listen(target, this.events);
35-
} else {
36-
INSTALLER.enableOnSubtree(target);
37-
}
26+
INSTALLER.enableOnSubtree(target);
3827
},
39-
unregister: function(target) {
40-
if (HAS_TOUCH_ACTION_DELAY) {
41-
dispatcher.unlisten(target, this.events);
42-
} else {
28+
unregister: function() {
4329

44-
// TODO(dfreedman): is it worth it to disconnect the MO?
45-
}
30+
// TODO(dfreedman): is it worth it to disconnect the MO?
4631
},
4732
elementAdded: function(el) {
4833
var a = el.getAttribute(ATTRIB);
@@ -362,9 +347,7 @@ var touchEvents = {
362347
}
363348
};
364349

365-
if (!HAS_TOUCH_ACTION_DELAY) {
366-
INSTALLER = new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,
367-
touchEvents.elementChanged, touchEvents);
368-
}
350+
INSTALLER = new Installer(touchEvents.elementAdded, touchEvents.elementRemoved,
351+
touchEvents.elementChanged, touchEvents);
369352

370353
export default touchEvents;

0 commit comments

Comments
 (0)