Skip to content

Commit

Permalink
WRR-9115: Scroller: Fixed to focus properly when the spottable node…
Browse files Browse the repository at this point in the history
… is bigger than the viewport by scrolling with voice control (#1748)

* WRR-9115: Fixed to focus properly when the spottable node is bigger than the viewport by scrolling with voice control

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim (myelyn.kim@lge.com)

* Fix changelog

Enact-DCO-1.0-Signed-off-by: Juwon Jeong (juwon.jeong@lge.com)

---------

Co-authored-by: Juwon Jeong <juwon.jeong@lge.com>
  • Loading branch information
mmyelyn and juwonjeong authored Dec 2, 2024
1 parent d0650cf commit 313bc48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The following is a curated list of changes in the Enact sandstone module, newest changes on the top.

## [unreleased]

### Fixed

- `sandstone/Scroller` to focus properly when the spottable node is bigger than the size of viewport by voice control

## [3.0.0-alpha.3] - 2024-12-02

### Added
Expand Down
4 changes: 2 additions & 2 deletions useScroll/useEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import platform from '@enact/core/platform';
import {onWindowReady} from '@enact/core/snapshot';
import {clamp} from '@enact/core/util';
import Spotlight, {getDirection} from '@enact/spotlight';
import {getPositionTargetOnFocus} from '@enact/spotlight/src/container';
import {getDeepSpottableDescendants, getPositionTargetOnFocus} from '@enact/spotlight/src/container';
import {getRect} from '@enact/spotlight/src/utils';
import {getTargetByDirectionFromElement} from '@enact/spotlight/src/target';
import {constants} from '@enact/ui/useScroll';
Expand Down Expand Up @@ -449,7 +449,7 @@ const useEventVoice = (props, instances) => {

/* if the focused element is out of the viewport, find another spottable element in the viewport */
if (spotItemBounds[last] <= viewportBounds[first] || spotItemBounds[first] >= viewportBounds[last]) {
const nodes = Spotlight.getSpottableDescendants(scrollContainerNode.dataset.spotlightId);
const nodes = getDeepSpottableDescendants(scrollContainerNode.dataset.spotlightId);
for (let i = 0; i < nodes.length; i++) {
const nodeBounds = nodes[i].getBoundingClientRect();

Expand Down

0 comments on commit 313bc48

Please sign in to comment.