bevyengine/bevy · warning · TabNavigationError

No tab groups found

Error message

No tab groups found

What it means

TabNavigation::navigate and TabNavigation::initialize return this when the world contains no entities with a TabGroup component (crates/bevy_input_focus/src/tab_navigation.rs:195). Tab navigation requires every focusable entity to be a descendant of a TabGroup, so with zero groups there is nothing to tab through.

Source

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

    /// Navigate to the previous focusable entity, wrapping around to the end if at the beginning.
    ///
    /// This is commonly triggered by pressing Shift+Tab.
    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.

View on GitHub (pinned to 396ca72708)

Solutions

  1. Add TabGroup::new(order) to the root node of each focusable UI subtree.
  2. For TabNavigation::initialize, pass a parent entity that itself carries the TabGroup component.
  3. Give groups distinct increasing order values so inter-group tab order matches the design.

Example fix

// before
commands.spawn(Node::default()).with_children(|p| {
    p.spawn((Button, TabIndex(0))); // no TabGroup anywhere -> NoTabGroups
});

// after
commands.spawn((Node::default(), 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;

fn has_tab_groups(groups: &Query<(), &TabGroup>) -> bool {
    !groups.is_empty()
}

Try / catch

if let Err(TabNavigationError::NoTabGroups) = tab_nav.navigate(&input_focus, action) {
    // spawn/attach TabGroup roots before retrying navigation
}

Prevention

When it happens

Trigger: Pressing Tab with TabNavigationPlugin + InputDispatchPlugin installed but no TabGroup anywhere in the scene; calling TabNavigation::navigate when tabgroup_query is empty; calling initialize(parent, ...) on a parent that itself lacks TabGroup (which also maps to this variant, tab_navigation.rs:231-233).

Common situations: Forgot to add TabGroup to the UI root; the group node was despawned with the menu; the component was added to an entity with no children so it never registers focusable descendants.

Related errors


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