You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] TreeList: focusing a parent row highlights the entire subtree (focus ring leaks onto all descendant rows) #4130
When a parent (expandable) TreeList row receives keyboard focus, the focus-visible outline is drawn around the parent and every one of its descendant rows — the whole subtree lights up instead of just the focused row.
Steps to reproduce
Render a TreeList with a parent row that has children, expanded.
Keyboard-focus the parent row (Tab into the tree / arrow to it).
Observe the focus ring.
Expected
Only the focused row shows the focus-visible outline.
Actual
The parent row and all of its nested child rows show the outline simultaneously (see screenshot).
Every row is a <li role="treeitem"> tagged with the treeItemScope marker, and child rows are DOM descendants of the parent <li> (standard APG tree nesting). stylex.when.ancestor(':focus-visible', treeItemScope) matches an element whenever any ancestor carrying treeItemScope is :focus-visible — so when the parent row is focused, the condition is true for the parent and for every descendant row nested inside it. The result is the ring leaking onto the entire subtree.
The intent (per the code comments) is to bind the ring to the row's own treeitem, but when.ancestor matches any ancestor treeitem, not the nearest/own one, so parent focus propagates down.
Suggested fix direction
Scope the outline to the row's own focus state rather than an ancestor match — e.g. apply :focus-visible directly on the row element (the <li> is the roving-tabindex focus owner), or gate the when.ancestor rule so a descendant treeitem cancels the inherited match. Keep the existing :has(:focus-visible) branch for inner focusable actions.
Activity
fix(TreeList): scope focus-visible outline to the focused row only (#…