{"record":{"id":"dbd933e34360d690","repo":"bevyengine/bevy","slug":"no-focusable-entities-found","errorCode":null,"errorMessage":"No focusable entities found","messagePattern":"No focusable entities found","errorType":"exception","errorClass":"TabNavigationError","httpStatus":null,"severity":"warning","filePath":"crates/bevy_input_focus/src/tab_navigation.rs","lineNumber":137,"sourceCode":"    Previous,\n    /// Navigate to the first focusable entity.\n    ///\n    /// This is commonly triggered by pressing Home.\n    First,\n    /// Navigate to the last focusable entity.\n    ///\n    /// This is commonly triggered by pressing End.\n    Last,\n}\n\n/// An error that can occur during [tab navigation](crate::tab_navigation).\n#[derive(Debug, Error, PartialEq, Eq, Clone)]\npub enum TabNavigationError {\n    /// No tab groups were found.\n    #[error(\"No tab groups found\")]\n    NoTabGroups,\n    /// No focusable entities were found.\n    #[error(\"No focusable entities found\")]\n    NoFocusableEntities,\n    /// Could not navigate to the next focusable entity.\n    ///\n    /// This can occur if your tab groups are malformed.\n    #[error(\"Failed to navigate to next focusable entity\")]\n    FailedToNavigateToNextFocusableEntity,\n    /// No tab group for the current focus entity was found.\n    #[error(\"No tab group found for currently focused entity {previous_focus}. Users will not be able to navigate back to this entity.\")]\n    NoTabGroupForCurrentFocus {\n        /// The entity that was previously focused,\n        /// and is missing its tab group.\n        previous_focus: Entity,\n        /// The new entity that will be focused.\n        ///\n        /// If you want to recover from this error, set [`InputFocus`] to this entity.\n        new_focus: Entity,\n    },\n}","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_input_focus/src/tab_navigation.rs#L119-L155","documentation":"Tab groups exist, but the navigation search found no focusable entities inside them. Focusable for tab navigation means descendants of a TabGroup carrying the TabIndex component, so groups without any tabbable children produce this error.","triggerScenarios":"Calling TabNavigation::navigate/initialize when TabGroup nodes exist but their subtrees contain no entities with TabIndex, or those entities fail the InheritedVisibility filter applied during the search.","commonSituations":"TabIndex added to entities outside the group subtree; all group children hidden (InheritedVisibility false); an empty UI template spawned by mistake; children added as siblings instead of descendants of the group node.","solutions":["Add TabIndex to the children of the TabGroup (TabIndex(0) is the usual sequential default).","Ensure focusable entities are real descendants of the group entity via the ChildOf hierarchy.","Make sure the focusable entities are visible (InheritedVisibility) when navigation runs."],"exampleFix":"// before: group exists but children lack TabIndex\ncommands.spawn(TabGroup::new(0)).with_children(|p| {\n    p.spawn(Button);\n});\n\n// after\ncommands.spawn(TabGroup::new(0)).with_children(|p| {\n    p.spawn((Button, TabIndex(0)));\n});","handlingStrategy":"validation","validationCode":"use bevy_ecs::prelude::*;\nuse bevy_input_focus::tab_navigation::{TabGroup, TabIndex};;\n\nfn group_has_focusable(children: &Children, tabindex: &Query<(), &TabIndex>) -> bool {\n    children.iter().any(|c| tabindex.contains(*c))\n}","typeGuard":null,"tryCatchPattern":"match tab_nav.navigate(&input_focus, action) {\n    Err(TabNavigationError::NoFocusableEntities) => { /* add TabIndex children or hide the UI */ }\n    Ok(next) => { input_focus.set(next, FocusCause::Navigated); }\n    Err(e) => warn!(\"{e}\"),\n}","preventionTips":["Add TabIndex to focusable children when spawning them inside a group.","Do not spawn empty TabGroup templates; guard template instantiation.","Check InheritedVisibility when tabbing through dynamic/animated UI."],"tags":["bevy","input-focus","tab-navigation","ui","keyboard","ecs-component"],"backgroundTag":"no-focusable-elements","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}