diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c8b355dc..7655c4065b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ The following is a curated list of changes in the Enact project, newest changes on the top. +## [unreleased] + +### Fixed + +- `spotlight` and `spotlight/SpotlightContainerDecorator` to handle pointer events even when pointer hasn't moved. + ## [4.0.7] - 2021-09-28 ### Fixed diff --git a/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js b/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js index 922ccbb4c0..80cad8ce96 100644 --- a/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js +++ b/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js @@ -1,10 +1,7 @@ import {forProp, handle, not, stop} from '@enact/core/handle'; -import {hasPointerMoved} from '../src/pointer'; import Spotlight from '../src/spotlight'; -const isNewPointerPosition = (ev) => hasPointerMoved(ev.clientX, ev.clientY); - class SpotlightContainer { // set up context and props so we can use handle binding context = {}; @@ -114,13 +111,11 @@ class SpotlightContainer { }; onPointerEnter = handle( - isNewPointerPosition, () => Spotlight.setActiveContainer(this.id) ).bindAs(this, 'onPointerEnter'); onPointerLeave = handle( not(forProp('restrict', 'self-only')), - isNewPointerPosition, (ev) => { const parentContainer = ev.currentTarget.parentNode.closest('[data-spotlight-container]'); let activeContainer = Spotlight.getActiveContainer(); diff --git a/packages/spotlight/src/spotlight.js b/packages/spotlight/src/spotlight.js index 3efffa750e..d9fc80d3da 100644 --- a/packages/spotlight/src/spotlight.js +++ b/packages/spotlight/src/spotlight.js @@ -62,7 +62,6 @@ import { import { getLastPointerPosition, getPointerMode, - hasPointerMoved, notifyKeyDown, notifyPointerMove, setPointerMode @@ -513,7 +512,7 @@ const Spotlight = (function () { const {target} = evt; - if (getPointerMode() && hasPointerMoved(evt.clientX, evt.clientY)) { + if (getPointerMode()) { const next = getNavigableTarget(target); // account for child controls if (next && next !== getCurrent()) {