diff --git a/src/services/GamepadNavigation/useContentGamepadNavigation.tsx b/src/services/GamepadNavigation/useContentGamepadNavigation.tsx index f5024f255..a7d24f4d9 100644 --- a/src/services/GamepadNavigation/useContentGamepadNavigation.tsx +++ b/src/services/GamepadNavigation/useContentGamepadNavigation.tsx @@ -3,11 +3,13 @@ import { useEffect, useRef } from 'react'; import { useGamepad } from '../GamepadContext'; -const FOCUSABLE = '[tabindex]'; +const FOCUSABLE = '[tabindex]:not([data-focus-guard])'; const getActiveScope = (fallback: HTMLDivElement | null): HTMLElement | null => { - const modal = document.querySelector('.modals-container'); - if (modal && modal.children.length > 0) return modal; + const modals = document.querySelectorAll('.modals-container'); + for (const modal of modals) { + if (modal.children.length > 0) return modal; + } const dropdown = fallback?.querySelector('[class*="dropdown"][class*="open"]'); if (dropdown) return dropdown;