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

Commit 19a970c

Browse files
committed
support touch-action in shadows
1 parent ce6eeda commit 19a970c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/touch-action.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* license that can be found in the LICENSE file.
55
*/
66
(function() {
7+
function shadowSelector(v) {
8+
return 'body ^^ ' + selector(v);
9+
}
710
function selector(v) {
811
return '[touch-action="' + v + '"]';
912
}
@@ -26,9 +29,11 @@
2629
var styles = '';
2730
attrib2css.forEach(function(r) {
2831
if (String(r) === r) {
29-
styles += selector(r) + rule(r);
32+
styles += selector(r) + rule(r) + '\n';
33+
styles += shadowSelector(r) + rule(r) + '\n';
3034
} else {
31-
styles += r.selectors.map(selector) + rule(r.rule);
35+
styles += r.selectors.map(selector) + rule(r.rule) + '\n';
36+
styles += r.selectors.map(shadowSelector) + rule(r.rule) + '\n';
3237
}
3338
});
3439
var el = document.createElement('style');

0 commit comments

Comments
 (0)