From 5eaa222d4778149318976cf83f0b17ed0468ec65 Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Wed, 17 Jul 2024 17:31:46 -0700 Subject: [PATCH] Navigable regions: skip empty regions --- packages/components/src/higher-order/navigate-regions/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/src/higher-order/navigate-regions/index.tsx b/packages/components/src/higher-order/navigate-regions/index.tsx index 1f4e79654e5bc1..601a1d88a69c40 100644 --- a/packages/components/src/higher-order/navigate-regions/index.tsx +++ b/packages/components/src/higher-order/navigate-regions/index.tsx @@ -49,7 +49,7 @@ export function useNavigateRegions( shortcuts: Shortcuts = defaultShortcuts ) { function focusRegion( offset: number ) { const regions = Array.from( ref.current?.querySelectorAll< HTMLElement >( - '[role="region"][tabindex="-1"]' + '[role="region"][tabindex="-1"]:not(:empty)' ) ?? [] ); if ( ! regions.length ) {