@enact/spotlight
Advanced tools
Comparing version 3.4.8 to 3.4.9-experimental-1
@@ -5,2 +5,12 @@ # Change Log | ||
## [3.4.9-experimental-1] - 2020-11-19 | ||
### Changed | ||
- `spotlight/SpotlightRootDecorator` to remove focus effect when touching up | ||
## [3.4.9] - 2020-10-30 | ||
No significant changes. | ||
## [3.4.8] - 2020-10-08 | ||
@@ -7,0 +17,0 @@ |
{ | ||
"name": "@enact/spotlight", | ||
"version": "3.4.8", | ||
"version": "3.4.9-experimental-1", | ||
"description": "A focus management library", | ||
@@ -21,3 +21,3 @@ "main": "src/spotlight.js", | ||
"dependencies": { | ||
"@enact/core": "^3.4.8", | ||
"@enact/core": "^3.4.9-experimental-1", | ||
"prop-types": "^15.7.2", | ||
@@ -24,0 +24,0 @@ "ramda": "^0.24.1", |
@@ -92,4 +92,26 @@ "use strict"; | ||
_this = _super.call(this, props); | ||
_this = _super.call(this, props); // In other modules, this reference DOM element could be referred by `#root > div`. | ||
_this.handlePointerOver = function (ev) { | ||
if (ev.pointerType === 'touch') { | ||
_this.containerRef.current.classList.remove('non-touch-mode'); | ||
_this.containerRef.current.classList.add('touch-mode'); | ||
} else if (ev.pointerType === 'mouse') { | ||
_this.containerRef.current.classList.add('non-touch-mode'); | ||
_this.containerRef.current.classList.remove('touch-mode'); | ||
} else { | ||
_this.containerRef.current.classList.remove('non-touch-mode'); | ||
_this.containerRef.current.classList.remove('touch-mode'); | ||
} | ||
}; | ||
_this.handleKeyDown = function () { | ||
_this.containerRef.current.classList.add('non-touch-mode'); | ||
_this.containerRef.current.classList.remove('touch-mode'); | ||
}; | ||
_this.navigableFilter = function (elem) { | ||
@@ -102,2 +124,4 @@ while (elem && elem !== document && elem.nodeType === 1) { | ||
_this.containerRef = /*#__PURE__*/_react["default"].createRef(); | ||
if (typeof window === 'object') { | ||
@@ -123,2 +147,10 @@ _spotlight["default"].initialize({ | ||
} | ||
this.containerRef.current.classList.add('non-touch-mode'); | ||
document.addEventListener('pointerover', this.handlePointerOver, { | ||
capture: true | ||
}); | ||
document.addEventListener('keydown', this.handleKeyDown, { | ||
capture: true | ||
}); | ||
} | ||
@@ -129,2 +161,9 @@ }, { | ||
_spotlight["default"].terminate(); | ||
document.removeEventListener('pointerover', this.handlePointerOver, { | ||
capture: true | ||
}); | ||
document.removeEventListener('keydown', this.handleKeyDown, { | ||
capture: true | ||
}); | ||
} | ||
@@ -134,3 +173,5 @@ }, { | ||
value: function render() { | ||
return /*#__PURE__*/_react["default"].createElement(Wrapped, this.props); | ||
return /*#__PURE__*/_react["default"].createElement("div", { | ||
ref: this.containerRef | ||
}, /*#__PURE__*/_react["default"].createElement(Wrapped, this.props)); | ||
} | ||
@@ -137,0 +178,0 @@ }]); |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
323471
6579
2