{"record":{"id":"c74072cd112f8531","repo":"bevyengine/bevy","slug":"navigation-explicitly-blocked-from-current-focus","errorCode":null,"errorMessage":"Navigation explicitly blocked from {current_focus} in the {direction:?} direction.","messagePattern":"Navigation explicitly blocked from (.+?) in the (.+?) direction\\.","errorType":"exception","errorClass":"DirectionalNavigationError","httpStatus":null,"severity":"info","filePath":"crates/bevy_input_focus/src/directional_navigation.rs","lineNumber":451,"sourceCode":"    }\n}\n\n/// An error that can occur when navigating between focusable entities using [directional navigation](crate::directional_navigation).\n#[derive(Debug, PartialEq, Clone, Error)]\npub enum DirectionalNavigationError {\n    /// No focusable entity is currently set.\n    #[error(\"No focusable entity is currently set.\")]\n    NoFocus,\n    /// No neighbor in the requested direction.\n    #[error(\"No neighbor from {current_focus} in the {direction:?} direction.\")]\n    NoNeighborInDirection {\n        /// The entity that was the focus when the error occurred.\n        current_focus: Entity,\n        /// The direction in which the navigation was attempted.\n        direction: CompassOctant,\n    },\n    /// Navigation explicitly blocked in the requested direction.\n    #[error(\"Navigation explicitly blocked from {current_focus} in the {direction:?} direction.\")]\n    BlockedNavigation {\n        /// The entity that was the focus when the error occurred.\n        current_focus: Entity,\n        /// The direction in which the navigation was attempted.\n        direction: CompassOctant,\n    },\n}\n\n/// A focusable area with position and size information.\n///\n/// This struct represents a UI element used during directional navigation,\n/// containing its entity ID, center position, and size for spatial navigation calculations.\n///\n/// The term \"focusable area\" avoids confusion with UI `Node` components in `bevy_ui`.\n#[derive(Debug, Clone, Copy, PartialEq)]\n#[cfg_attr(\n    feature = \"bevy_reflect\",\n    derive(Reflect),","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_input_focus/src/directional_navigation.rs#L433-L469","documentation":"The focused entity has an explicit block for the requested direction in the DirectionalNavigationMap, added via block_edge or block_symmetrical_edge. This is deliberate denial, distinct from NoNeighborInDirection: a block exists and navigation was intentionally forbidden.","triggerScenarios":"Calling navigate in a direction for which block_edge/block_symmetrical_edge was previously called on the currently focused entity.","commonSituations":"Modal dialogs blocking navigation away from the dialog; intentional one-way menus; a block added during prototyping and forgotten.","solutions":["If blocking is intended, handle the error silently or give feedback (sound, shake) — do nothing to focus.","Remove the block_edge/block_symmetrical_edge call if navigation should be allowed.","Remember that blocking a cardinal direction (e.g. North) does not block its diagonals (NorthEast/NorthWest); block those explicitly too."],"exampleFix":"// before\nnav_map.block_edge(modal_root, CompassOctant::South); // then navigate(South) errors\n\n// after: keep the block, handle it intentionally\nmatch nav.navigate(CompassOctant::South) {\n    Err(DirectionalNavigationError::BlockedNavigation { .. }) => {\n        // play a 'denied' cue; focus stays put\n    }\n    _ => {}\n}","handlingStrategy":"fallback","validationCode":"use bevy_input_focus::directional_navigation::DirectionalNavigationMap;\n\nfn is_blocked(map: &DirectionalNavigationMap, focus: Entity, dir: CompassOctant) -> bool {\n    map.get_neighbors(focus)\n        .map(|n| n.get(dir).is_blocked())\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match nav.navigate(dir) {\n    Err(DirectionalNavigationError::BlockedNavigation { .. }) => {\n        // intentional: play a denied cue, focus stays\n    }\n    _ => {}\n}","preventionTips":["Track where you call block_edge/block_symmetrical_edge so blocks are deliberate.","Block diagonals too when blocking a cardinal direction.","Keep blocked-direction handling distinct from no-neighbor handling in your input code."],"tags":["bevy","input-focus","directional-navigation","ui","modal"],"backgroundTag":"navigation-blocked-by-config","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}