bevyengine/bevy · warning · TabNavigationError

No focusable entities found

Error message

No focusable entities found

What it means

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.

Source

Thrown at crates/bevy_input_focus/src/tab_navigation.rs:137

    Previous,
    /// Navigate to the first focusable entity.
    ///
    /// This is commonly triggered by pressing Home.
    First,
    /// Navigate to the last focusable entity.
    ///
    /// This is commonly triggered by pressing End.
    Last,
}

/// An error that can occur during [tab navigation](crate::tab_navigation).
#[derive(Debug, Error, PartialEq, Eq, Clone)]
pub enum TabNavigationError {
    /// No tab groups were found.
    #[error("No tab groups found")]
    NoTabGroups,
    /// No focusable entities were found.
    #[error("No focusable entities found")]
    NoFocusableEntities,
    /// Could not navigate to the next focusable entity.
    ///
    /// This can occur if your tab groups are malformed.
    #[error("Failed to navigate to next focusable entity")]
    FailedToNavigateToNextFocusableEntity,
    /// No tab group for the current focus entity was found.
    #[error("No tab group found for currently focused entity {previous_focus}. Users will not be able to navigate back to this entity.")]
    NoTabGroupForCurrentFocus {
        /// The entity that was previously focused,
        /// and is missing its tab group.
        previous_focus: Entity,
        /// The new entity that will be focused.
        ///
        /// If you want to recover from this error, set [`InputFocus`] to this entity.
        new_focus: Entity,
    },
}

View on GitHub (pinned to 396ca72708)

Solutions

  1. Add TabIndex to the children of the TabGroup (TabIndex(0) is the usual sequential default).
  2. Ensure focusable entities are real descendants of the group entity via the ChildOf hierarchy.
  3. Make sure the focusable entities are visible (InheritedVisibility) when navigation runs.

Example fix

// before: group exists but children lack TabIndex
commands.spawn(TabGroup::new(0)).with_children(|p| {
    p.spawn(Button);
});

// after
commands.spawn(TabGroup::new(0)).with_children(|p| {
    p.spawn((Button, TabIndex(0)));
});
Defensive patterns

Strategy: validation

Validate before calling

use bevy_ecs::prelude::*;
use bevy_input_focus::tab_navigation::{TabGroup, TabIndex};;

fn group_has_focusable(children: &Children, tabindex: &Query<(), &TabIndex>) -> bool {
    children.iter().any(|c| tabindex.contains(*c))
}

Try / catch

match tab_nav.navigate(&input_focus, action) {
    Err(TabNavigationError::NoFocusableEntities) => { /* add TabIndex children or hide the UI */ }
    Ok(next) => { input_focus.set(next, FocusCause::Navigated); }
    Err(e) => warn!("{e}"),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/dbd933e34360d690. Report an issue: GitHub.