fix(tab_navigation): skip hidden subtrees during focusable gathering#24968
Merged
alice-i-cecile merged 1 commit intoJul 14, 2026
Merged
Conversation
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
approved these changes
Jul 13, 2026
Contributor
|
Turns out this broke the popup menus, adding a ticket. |
Contributor
|
Wait, this isn't merged, so something else broke it. Never mind! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #24935. Fixes a regression introduced in #24769 where menus would auto-close immediately on open.
gather_focusablewas skipping hidden entities from the focusable list but still traversing their children. In thefeathers_galleryexample,FeathersMenuPopupis always present in the hierarchy and shown/hidden viaVisibility. When a menu was opened, the popup's children had not yet had theirInheritedVisibilitypropagated, 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
InheritedVisibilitycheck ingather_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
feathers_galleryexample no longer auto-closes menus on open.