enactjs / sandstone

The set of components for an Enact-based application targeting smart TVs
Apache License 2.0
22 stars 3 forks source link

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

Closed mmyelyn closed 2 days ago

mmyelyn commented 2 weeks ago

Checklist

Issue Resolved / Feature Added

When scrolling down with voice control in certain apps, focus is not restored. Currently, when scrolling with voice control, focus is moved only when the bounds of the viewport include all bounds of the node.

Therefore, it is necessary to handle the case where the node's bounds are not all included in the viewport's bounds. (when there is a large node that goes out of bounds, the upper part is visible but the lower part is cut off, etc.)

Resolution

Added focus logic for cases where the top of the node is long and the bottom of the node is long using node Bounds and viewports Bounds. Since I need to receive and check new nodes, I implemented it using a recursive function.

Additional Considerations

Links

WRR-9115

Comments

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

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.93%. Comparing base (d0d3384) to head (4db12f9). Report is 8 commits behind head on release/2.9.x.develop.

Files with missing lines Patch % Lines
useScroll/useEvent.js 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/2.9.x.develop #1740 +/- ## ====================================================== Coverage 80.93% 80.93% ====================================================== Files 148 148 Lines 6693 6693 Branches 1994 1994 ====================================================== Hits 5417 5417 Misses 968 968 Partials 308 308 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.