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 d9448d7Copy full SHA for d9448d7
src/TreeView/useRovingTabIndex.ts
@@ -22,6 +22,24 @@ export function useRovingTabIndex({
22
getNextFocusable: (direction, from, event) => {
23
if (!(from instanceof HTMLElement)) return
24
25
+ // Skip top layer elements
26
+ try {
27
+ // These need to be separate if conditions as different
28
+ // browsers may or may not support them. While we could
29
+ // use `:where`, engines like JSDom will still throw.
30
+ if (from.closest('dialog[open]')) {
31
+ return
32
+ }
33
+ if (from.closest(':popover-open')) {
34
35
36
+ if (from.closest('.:popover-open')) {
37
38
39
+ } catch {
40
+ // Don't return
41
42
+
43
return getNextFocusableElement(from, event) ?? from
44
},
45
focusInStrategy: () => {
0 commit comments