@enact/spotlight
Advanced tools
Comparing version 3.4.9-experimental-1 to 3.4.9-experimental-2
@@ -5,2 +5,8 @@ # Change Log | ||
## [3.4.9-experimental-2] - 2020-12-03 | ||
### Fixed | ||
- `spotlight/SpotlightRootDecorator` to ignore `enter` key in touch mode | ||
## [3.4.9-experimental-1] - 2020-11-19 | ||
@@ -7,0 +13,0 @@ |
{ | ||
"name": "@enact/spotlight", | ||
"version": "3.4.9-experimental-1", | ||
"version": "3.4.9-experimental-2", | ||
"description": "A focus management library", | ||
@@ -21,3 +21,3 @@ "main": "src/spotlight.js", | ||
"dependencies": { | ||
"@enact/core": "^3.4.9-experimental-1", | ||
"@enact/core": "^3.4.9-experimental-2", | ||
"prop-types": "^15.7.2", | ||
@@ -24,0 +24,0 @@ "ramda": "^0.24.1", |
@@ -10,2 +10,4 @@ "use strict"; | ||
var _keymap = require("@enact/core/keymap"); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -111,6 +113,13 @@ | ||
_this.handleKeyDown = function () { | ||
_this.containerRef.current.classList.add('non-touch-mode'); | ||
_this.handleKeyDown = function (ev) { | ||
var keyCode = ev.keyCode; | ||
_this.containerRef.current.classList.remove('touch-mode'); | ||
if ((0, _keymap.is)('enter', keyCode) && _this.containerRef.current.classList.contains('touch-mode')) { | ||
// Prevent onclick event trigger by enter key | ||
ev.preventDefault(); | ||
} else { | ||
_this.containerRef.current.classList.add('non-touch-mode'); | ||
_this.containerRef.current.classList.remove('touch-mode'); | ||
} | ||
}; | ||
@@ -117,0 +126,0 @@ |
323909
6586