From 34fbb3fc44ae5531dc7684aea4a0fbb64e9be095 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Wed, 13 Oct 2021 15:16:16 +0900 Subject: [PATCH 1/2] Remove hasPointerMoved from spotlight Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- CHANGELOG.md | 6 ++++++ .../SpotlightContainerDecorator/SpotlightContainer.js | 2 -- packages/spotlight/src/spotlight.js | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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..e603caac09 100644 --- a/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js +++ b/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js @@ -114,13 +114,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..d9ee9a8fa1 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,8 @@ const Spotlight = (function () { const {target} = evt; - if (getPointerMode() && hasPointerMoved(evt.clientX, evt.clientY)) { + if (getPointerMode()) { + console.log('onMouseOver'); const next = getNavigableTarget(target); // account for child controls if (next && next !== getCurrent()) { From b4a60e74422888f436b83721b2d1d30c9c4b81e9 Mon Sep 17 00:00:00 2001 From: Juwon Jeong Date: Mon, 18 Oct 2021 18:00:22 +0900 Subject: [PATCH 2/2] Minor change Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com) --- .../SpotlightContainerDecorator/SpotlightContainer.js | 3 --- packages/spotlight/src/spotlight.js | 1 - 2 files changed, 4 deletions(-) diff --git a/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js b/packages/spotlight/SpotlightContainerDecorator/SpotlightContainer.js index e603caac09..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 = {}; diff --git a/packages/spotlight/src/spotlight.js b/packages/spotlight/src/spotlight.js index d9ee9a8fa1..d9fc80d3da 100644 --- a/packages/spotlight/src/spotlight.js +++ b/packages/spotlight/src/spotlight.js @@ -513,7 +513,6 @@ const Spotlight = (function () { const {target} = evt; if (getPointerMode()) { - console.log('onMouseOver'); const next = getNavigableTarget(target); // account for child controls if (next && next !== getCurrent()) {