Skip to content

Commit

Permalink
WRR-9115: Fixed to focus properly when the spottable node is bigger t…
Browse files Browse the repository at this point in the history
…han the viewport by scrolling with voice control

Enact-DCO-1.0-Signed-off-by: Hyelyn Kim (myelyn.kim@lge.com)
  • Loading branch information
mmyelyn committed Nov 14, 2024
1 parent e3f7eaa commit 47a6245
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The following is a curated list of changes in the Enact sandstone module, newest
- `sandstone/PageViews` and `sandstone/QuickGuidePanels` dot page indicators to be aligned center
- `sandstone/PageViews` to not clip the shadow of navigation buttons when `fullContents` prop is `true`
- `sandstone/Scroller` to focus content area properly on supported platforms when `focusableScrollbar` prop is `byEnter`
- `sandstone/Scroller` to focus properly when the spottable node is bigger than the size of viewport by voice control
- `sandstone/Scroller` with `editable` prop to move an item via 5-way keys properly in pointer mode

## [3.0.0-alpha.2] - 2024-10-08
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);

Check warning on line 452 in useScroll/useEvent.js

View check run for this annotation

Codecov / codecov/patch

useScroll/useEvent.js#L452

Added line #L452 was not covered by tests
for (let i = 0; i < nodes.length; i++) {
const nodeBounds = nodes[i].getBoundingClientRect();

Expand Down

0 comments on commit 47a6245

Please sign in to comment.