NXT-7491 [2027TV] POC on 2way focus browsing#3412
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3412 +/- ##
===========================================
+ Coverage 86.06% 87.32% +1.26%
===========================================
Files 156 158 +2
Lines 7613 7971 +358
Branches 2015 2126 +111
===========================================
+ Hits 6552 6961 +409
+ Misses 845 807 -38
+ Partials 216 203 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3ef6249 to
7f2e4f0
Compare
There was a problem hiding this comment.
Before reading my comments, please do a self-review of the entire PR.
It was really hard to go through the PR as the PR description speaks very thin about navigation between some dropdowns, while de DoD of the user story mentions a broader scope. The PR Description should explain in technical details what all these changes in the PR do, how the new flow works etc.
The PR description should be oriented towards an outside user, so it can be easily understood how it works and what it does
daniel-stoian-lgp
left a comment
There was a problem hiding this comment.
check my tests comments.
5038303 to
e5bfacb
Compare
3010141 to
69ca424
Compare
daniel-stoian-lgp
left a comment
There was a problem hiding this comment.
check my comments
a0c333a to
ed9ee1b
Compare
|
The function extraction looks good. Could you do the following:
|
daniel-stoian-lgp
left a comment
There was a problem hiding this comment.
LGTM. thank you for your effort
bafb77e to
3d57553
Compare
Checklist
Issue Resolved / Feature Added
This change adds Tab / Shift+Tab keyboard navigation to Spotlight for Enact apps.
Before: Spotlight did not handle the Tab key. Tab used the browser’s default focus behavior, which does not understand Enact’s focus model (spottable controls, spotlight containers, portaled content). Keyboard users could not rely on Tab to move focus in a consistent, layout-based order across the UI.
After: Spotlight handles Tab and Shift+Tab and moves focus among spottable controls in visual order on screen (top to bottom, then left to right; mirrored for RTL).
This applies broadly—to any spottable UI, including lists, grids (e.g. VirtualGridList items), buttons, and form controls. The PR also adds extra behavior for open dropdown popups (portaled lists linked to triggers via aria-owns), which was the main motivation and test focus for this story.
Resolution
What this PR introduces
When the user presses Tab or Shift+Tab, Spotlight:
This works for normal page content, grid layouts, lists, and any other component built with spottable children—including VirtualGridList, for rendered/visible items in the DOM.
Note: Virtualized lists only include items currently in the DOM, so Tab moves through visible spottable items, not the full virtual dataset.
Dropdown option lists use a special Enact pattern: a portaled popup list in a self-only spotlight container, linked to its trigger through aria-owns. For this case, Spotlight adds:
Example (three open dropdowns):
last option in A → first option in B → first option in C → close button
(one Tab per step; Shift+Tab reverses)
Unchanged
5-way (arrow key) navigation — not modified
Public Spotlight API — no breaking changes; apps do not need code updates
How it works (simple overview)
Other cases: Tab is managed while Spotlight is paused (modal); Tab is skipped if the pointer moved during the key press; RTL layouts are supported.
Additional Considerations
Links
NXT-7491
Comments
Enact-DCO-1.0-Signed-off-by: Dan Ichim (dan.ichim@lgepartner.com)