We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bcec87 commit f0e3ad4Copy full SHA for f0e3ad4
src/TreeView/useRovingTabIndex.ts
@@ -22,6 +22,17 @@ export function useRovingTabIndex({
22
getNextFocusable: (direction, from, event) => {
23
if (!(from instanceof HTMLElement)) return
24
25
+ // Skip elements within a modal dialog
26
+ // This need to be in a try/catch to avoid errors in
27
+ // non-supported browsers
28
+ try {
29
+ if (from.closest('dialog:modal')) {
30
+ return
31
+ }
32
+ } catch {
33
+ // Don't return
34
35
+
36
return getNextFocusableElement(from, event) ?? from
37
},
38
focusInStrategy: () => {
0 commit comments