WRP-12378: Fixed Scroller and VirtualList to focus Spottable container items properly via page up/down #1437
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Issue Resolved / Feature Added
When a page up/down key is pressed on items in a scroller or a list, an expected behavior is to scroll a page and focus an item at the same visual position normally.
And, if page up is pressed at the first page or page down is pressed at the last page, an expected behavior is to scroll to the edge then focus the first (for page up) or the last (for page down) item.
The reported issue is that, the focus disappears on page down key at the last page when the last item is spotlight container that has a spottable node not attached to the bottom of the item.
Resolution
useScroll
has a logic to find an item to focus and it was working well for items that are not Spotlight containers as it searches candidates from the last active Spotlight container. To fix this, I changed the starting node from the last active Spotlight container to a scroll container.Additional Considerations
Links
WRP-12378
#1434
Comments
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)