Skip to content

fix(tab_navigation): skip hidden subtrees during focusable gathering#24968

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
Cyannide:feathers_focus_regression
Jul 14, 2026
Merged

fix(tab_navigation): skip hidden subtrees during focusable gathering#24968
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
Cyannide:feathers_focus_regression

Conversation

@Cyannide

Copy link
Copy Markdown
Contributor

Summary

Fixes #24935. Fixes a regression introduced in #24769 where menus would auto-close immediately on open.

gather_focusable was skipping hidden entities from the focusable list but still traversing their children. In the feathers_gallery example, FeathersMenuPopup is always present in the hierarchy and shown/hidden via Visibility. When a menu was opened, the popup's children had not yet had their InheritedVisibility propagated, so they were visited, found unfocusable, and focus fell outside the menu — which the menu interpreted as a close signal.

Solution

Move the children traversal inside the InheritedVisibility check in gather_focusable, so that a hidden entity stops traversal of its entire subtree. This matches the expected behaviour: if a container is hidden, none of its descendants should be reachable via tab navigation.

Testing

  • Verified the feathers_gallery example no longer auto-closes menus on open.
  • Existing tab navigation tests continue to pass.

Previously, gather_focusable would skip pushing a hidden entity to the
focusable list but still traverse its children. This caused menus to
auto-close on open, since hidden menu popup items were visited and found
unfocusable, causing focus to fall outside the menu.

Move the children traversal inside the InheritedVisibility check so that
a hidden entity stops traversal of its entire subtree.

Fixes regression introduced in bevyengine#24769.
@alice-i-cecile alice-i-cecile added this to the 0.20 milestone Jul 13, 2026
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy A-UI Graphical user interfaces, styles, layouts, and widgets S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jul 13, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Jul 13, 2026
@viridia

viridia commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Turns out this broke the popup menus, adding a ticket.

@viridia

viridia commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Wait, this isn't merged, so something else broke it. Never mind!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 14, 2026
Merged via the queue into bevyengine:main with commit bda4aad Jul 14, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Feathers menu cannot be opened

3 participants