@react-aria/focus 3.15.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +44 -34
- package/dist/main.js +44 -34
- package/dist/main.js.map +1 -1
- package/dist/module.js +44 -34
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/FocusScope.tsx +40 -32
- package/src/focusSafely.ts +4 -3
- package/src/isElementVisible.ts +4 -1
- package/src/useFocusable.tsx +1 -1
package/dist/module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import {useLayoutEffect as $6nfFC$useLayoutEffect, getOwnerDocument as $6nfFC$getOwnerDocument, runAfterTransition as $6nfFC$runAfterTransition, focusWithoutScrolling as $6nfFC$focusWithoutScrolling, getOwnerWindow as $6nfFC$getOwnerWindow, mergeProps as $6nfFC$mergeProps, useSyncRef as $6nfFC$useSyncRef, useObjectRef as $6nfFC$useObjectRef} from "@react-aria/utils";
|
|
1
2
|
import $6nfFC$react, {useRef as $6nfFC$useRef, useContext as $6nfFC$useContext, useMemo as $6nfFC$useMemo, useEffect as $6nfFC$useEffect, useState as $6nfFC$useState, useCallback as $6nfFC$useCallback} from "react";
|
|
2
|
-
import {useLayoutEffect as $6nfFC$useLayoutEffect, runAfterTransition as $6nfFC$runAfterTransition, focusWithoutScrolling as $6nfFC$focusWithoutScrolling, mergeProps as $6nfFC$mergeProps, useSyncRef as $6nfFC$useSyncRef, useObjectRef as $6nfFC$useObjectRef} from "@react-aria/utils";
|
|
3
3
|
import {getInteractionModality as $6nfFC$getInteractionModality, isFocusVisible as $6nfFC$isFocusVisible, useFocusVisibleListener as $6nfFC$useFocusVisibleListener, useFocus as $6nfFC$useFocus, useFocusWithin as $6nfFC$useFocusWithin, useKeyboard as $6nfFC$useKeyboard} from "@react-aria/interactions";
|
|
4
4
|
import $6nfFC$clsx from "clsx";
|
|
5
5
|
|
|
@@ -41,16 +41,18 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
|
41
41
|
// the page before shifting focus. This avoids issues with VoiceOver on iOS
|
|
42
42
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
43
43
|
// from off the screen.
|
|
44
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(element);
|
|
44
45
|
if ((0, $6nfFC$getInteractionModality)() === "virtual") {
|
|
45
|
-
let lastFocusedElement =
|
|
46
|
+
let lastFocusedElement = ownerDocument.activeElement;
|
|
46
47
|
(0, $6nfFC$runAfterTransition)(()=>{
|
|
47
48
|
// If focus did not move and the element is still in the document, focus it.
|
|
48
|
-
if (
|
|
49
|
+
if (ownerDocument.activeElement === lastFocusedElement && element.isConnected) (0, $6nfFC$focusWithoutScrolling)(element);
|
|
49
50
|
});
|
|
50
51
|
} else (0, $6nfFC$focusWithoutScrolling)(element);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
|
|
55
|
+
|
|
54
56
|
/*
|
|
55
57
|
* Copyright 2021 Adobe. All rights reserved.
|
|
56
58
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -61,8 +63,10 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
|
61
63
|
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
62
64
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
63
65
|
* governing permissions and limitations under the License.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
+
*/
|
|
67
|
+
function $645f2e67b85a24c9$var$isStyleVisible(element) {
|
|
68
|
+
const windowObject = (0, $6nfFC$getOwnerWindow)(element);
|
|
69
|
+
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
|
|
66
70
|
let { display: display, visibility: visibility } = element.style;
|
|
67
71
|
let isVisible = display !== "none" && visibility !== "hidden" && visibility !== "collapse";
|
|
68
72
|
if (isVisible) {
|
|
@@ -81,7 +85,6 @@ function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
|
|
|
81
85
|
|
|
82
86
|
|
|
83
87
|
|
|
84
|
-
|
|
85
88
|
const $9bf71ea28793e738$var$FocusContext = /*#__PURE__*/ (0, $6nfFC$react).createContext(null);
|
|
86
89
|
let $9bf71ea28793e738$var$activeScope = null;
|
|
87
90
|
function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
@@ -139,7 +142,7 @@ function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
|
|
|
139
142
|
// This needs to be an effect so that activeScope is updated after the FocusScope tree is complete.
|
|
140
143
|
// It cannot be a useLayoutEffect because the parent of this node hasn't been attached in the tree yet.
|
|
141
144
|
(0, $6nfFC$useEffect)(()=>{
|
|
142
|
-
|
|
145
|
+
const activeElement = (0, $6nfFC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement;
|
|
143
146
|
let scope = null;
|
|
144
147
|
if ($9bf71ea28793e738$var$isElementInScope(activeElement, scopeRef.current)) {
|
|
145
148
|
// We need to traverse the focusScope tree and find the bottom most scope that
|
|
@@ -193,7 +196,7 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
193
196
|
focusNext (opts = {}) {
|
|
194
197
|
let scope = scopeRef.current;
|
|
195
198
|
let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
|
|
196
|
-
let node = from ||
|
|
199
|
+
let node = from || (0, $6nfFC$getOwnerDocument)(scope[0]).activeElement;
|
|
197
200
|
let sentinel = scope[0].previousElementSibling;
|
|
198
201
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
199
202
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {
|
|
@@ -212,7 +215,7 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
212
215
|
focusPrevious (opts = {}) {
|
|
213
216
|
let scope = scopeRef.current;
|
|
214
217
|
let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
|
|
215
|
-
let node = from ||
|
|
218
|
+
let node = from || (0, $6nfFC$getOwnerDocument)(scope[0]).activeElement;
|
|
216
219
|
let sentinel = scope[scope.length - 1].nextElementSibling;
|
|
217
220
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
218
221
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(scopeRoot, {
|
|
@@ -298,10 +301,11 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
298
301
|
}
|
|
299
302
|
return;
|
|
300
303
|
}
|
|
304
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scope ? scope[0] : undefined);
|
|
301
305
|
// Handle the Tab key to contain focus within the scope
|
|
302
306
|
let onKeyDown = (e)=>{
|
|
303
307
|
if (e.key !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef)) return;
|
|
304
|
-
let focusedElement =
|
|
308
|
+
let focusedElement = ownerDocument.activeElement;
|
|
305
309
|
let scope = scopeRef.current;
|
|
306
310
|
if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;
|
|
307
311
|
let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);
|
|
@@ -336,9 +340,9 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
336
340
|
if (raf.current) cancelAnimationFrame(raf.current);
|
|
337
341
|
raf.current = requestAnimationFrame(()=>{
|
|
338
342
|
// Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe
|
|
339
|
-
if (
|
|
343
|
+
if (ownerDocument.activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(ownerDocument.activeElement, scopeRef)) {
|
|
340
344
|
$9bf71ea28793e738$var$activeScope = scopeRef;
|
|
341
|
-
if (
|
|
345
|
+
if (ownerDocument.body.contains(e.target)) {
|
|
342
346
|
var _focusedNode_current;
|
|
343
347
|
focusedNode.current = e.target;
|
|
344
348
|
(_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();
|
|
@@ -346,13 +350,13 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
346
350
|
}
|
|
347
351
|
});
|
|
348
352
|
};
|
|
349
|
-
|
|
350
|
-
|
|
353
|
+
ownerDocument.addEventListener("keydown", onKeyDown, false);
|
|
354
|
+
ownerDocument.addEventListener("focusin", onFocus, false);
|
|
351
355
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener("focusin", onFocus, false));
|
|
352
356
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener("focusout", onBlur, false));
|
|
353
357
|
return ()=>{
|
|
354
|
-
|
|
355
|
-
|
|
358
|
+
ownerDocument.removeEventListener("keydown", onKeyDown, false);
|
|
359
|
+
ownerDocument.removeEventListener("focusin", onFocus, false);
|
|
356
360
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener("focusin", onFocus, false));
|
|
357
361
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener("focusout", onBlur, false));
|
|
358
362
|
};
|
|
@@ -436,7 +440,8 @@ function $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus) {
|
|
|
436
440
|
(0, $6nfFC$useEffect)(()=>{
|
|
437
441
|
if (autoFocusRef.current) {
|
|
438
442
|
$9bf71ea28793e738$var$activeScope = scopeRef;
|
|
439
|
-
|
|
443
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);
|
|
444
|
+
if (!$9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, $9bf71ea28793e738$var$activeScope.current) && scopeRef.current) $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);
|
|
440
445
|
}
|
|
441
446
|
autoFocusRef.current = false;
|
|
442
447
|
}, [
|
|
@@ -449,15 +454,16 @@ function $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain)
|
|
|
449
454
|
(0, $6nfFC$useLayoutEffect)(()=>{
|
|
450
455
|
if (restore || contain) return;
|
|
451
456
|
let scope = scopeRef.current;
|
|
457
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scope ? scope[0] : undefined);
|
|
452
458
|
let onFocus = (e)=>{
|
|
453
459
|
let target = e.target;
|
|
454
460
|
if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
455
461
|
else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;
|
|
456
462
|
};
|
|
457
|
-
|
|
463
|
+
ownerDocument.addEventListener("focusin", onFocus, false);
|
|
458
464
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener("focusin", onFocus, false));
|
|
459
465
|
return ()=>{
|
|
460
|
-
|
|
466
|
+
ownerDocument.removeEventListener("focusin", onFocus, false);
|
|
461
467
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener("focusin", onFocus, false));
|
|
462
468
|
};
|
|
463
469
|
}, [
|
|
@@ -476,21 +482,23 @@ function $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {
|
|
|
476
482
|
}
|
|
477
483
|
function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
|
|
478
484
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
479
|
-
|
|
485
|
+
// eslint-disable-next-line no-restricted-globals
|
|
486
|
+
const nodeToRestoreRef = (0, $6nfFC$useRef)(typeof document !== "undefined" ? (0, $6nfFC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
|
|
480
487
|
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus
|
|
481
488
|
// restoring-non-containing scopes should only care if they become active so they can perform the restore
|
|
482
489
|
(0, $6nfFC$useLayoutEffect)(()=>{
|
|
483
490
|
let scope = scopeRef.current;
|
|
491
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scope ? scope[0] : undefined);
|
|
484
492
|
if (!restoreFocus || contain) return;
|
|
485
493
|
let onFocus = ()=>{
|
|
486
494
|
// If focusing an element in a child scope of the currently active scope, the child becomes active.
|
|
487
495
|
// Moving out of the active scope to an ancestor is not allowed.
|
|
488
|
-
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(
|
|
496
|
+
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
489
497
|
};
|
|
490
|
-
|
|
498
|
+
ownerDocument.addEventListener("focusin", onFocus, false);
|
|
491
499
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener("focusin", onFocus, false));
|
|
492
500
|
return ()=>{
|
|
493
|
-
|
|
501
|
+
ownerDocument.removeEventListener("focusin", onFocus, false);
|
|
494
502
|
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener("focusin", onFocus, false));
|
|
495
503
|
};
|
|
496
504
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -499,6 +507,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
499
507
|
contain
|
|
500
508
|
]);
|
|
501
509
|
(0, $6nfFC$useLayoutEffect)(()=>{
|
|
510
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);
|
|
502
511
|
if (!restoreFocus) return;
|
|
503
512
|
// Handle the Tab key so that tabbing out of the scope goes to the next element
|
|
504
513
|
// after the node that had focus when the scope mounted. This is important when
|
|
@@ -506,19 +515,19 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
506
515
|
// tabbing out of the overlay.
|
|
507
516
|
let onKeyDown = (e)=>{
|
|
508
517
|
if (e.key !== "Tab" || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef)) return;
|
|
509
|
-
let focusedElement =
|
|
518
|
+
let focusedElement = ownerDocument.activeElement;
|
|
510
519
|
if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scopeRef.current)) return;
|
|
511
520
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
512
521
|
if (!treeNode) return;
|
|
513
522
|
let nodeToRestore = treeNode.nodeToRestore;
|
|
514
523
|
// Create a DOM tree walker that matches all tabbable elements
|
|
515
|
-
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(
|
|
524
|
+
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ownerDocument.body, {
|
|
516
525
|
tabbable: true
|
|
517
526
|
});
|
|
518
527
|
// Find the next tabbable element after the currently focused element
|
|
519
528
|
walker.currentNode = focusedElement;
|
|
520
529
|
let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
|
|
521
|
-
if (!nodeToRestore || !
|
|
530
|
+
if (!nodeToRestore || !ownerDocument.body.contains(nodeToRestore) || nodeToRestore === ownerDocument.body) {
|
|
522
531
|
nodeToRestore = undefined;
|
|
523
532
|
treeNode.nodeToRestore = undefined;
|
|
524
533
|
}
|
|
@@ -539,9 +548,9 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
539
548
|
else $9bf71ea28793e738$var$focusElement(nodeToRestore, true);
|
|
540
549
|
}
|
|
541
550
|
};
|
|
542
|
-
if (!contain)
|
|
551
|
+
if (!contain) ownerDocument.addEventListener("keydown", onKeyDown, true);
|
|
543
552
|
return ()=>{
|
|
544
|
-
if (!contain)
|
|
553
|
+
if (!contain) ownerDocument.removeEventListener("keydown", onKeyDown, true);
|
|
545
554
|
};
|
|
546
555
|
}, [
|
|
547
556
|
scopeRef,
|
|
@@ -550,6 +559,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
550
559
|
]);
|
|
551
560
|
// useLayoutEffect instead of useEffect so the active element is saved synchronously instead of asynchronously.
|
|
552
561
|
(0, $6nfFC$useLayoutEffect)(()=>{
|
|
562
|
+
const ownerDocument = (0, $6nfFC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);
|
|
553
563
|
if (!restoreFocus) return;
|
|
554
564
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
555
565
|
if (!treeNode) return;
|
|
@@ -561,16 +571,16 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
561
571
|
let nodeToRestore = treeNode.nodeToRestore;
|
|
562
572
|
// if we already lost focus to the body and this was the active scope, then we should attempt to restore
|
|
563
573
|
if (restoreFocus && nodeToRestore && // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
564
|
-
($9bf71ea28793e738$var$isElementInScope(
|
|
574
|
+
($9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current) || ownerDocument.activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
|
|
565
575
|
// freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it
|
|
566
576
|
let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();
|
|
567
577
|
requestAnimationFrame(()=>{
|
|
568
578
|
// Only restore focus if we've lost focus to the body, the alternative is that focus has been purposefully moved elsewhere
|
|
569
|
-
if (
|
|
579
|
+
if (ownerDocument.activeElement === ownerDocument.body) {
|
|
570
580
|
// look up the tree starting with our scope to find a nodeToRestore still in the DOM
|
|
571
581
|
let treeNode = clonedTree.getTreeNode(scopeRef);
|
|
572
582
|
while(treeNode){
|
|
573
|
-
if (treeNode.nodeToRestore &&
|
|
583
|
+
if (treeNode.nodeToRestore && treeNode.nodeToRestore.isConnected) {
|
|
574
584
|
$9bf71ea28793e738$var$focusElement(treeNode.nodeToRestore);
|
|
575
585
|
return;
|
|
576
586
|
}
|
|
@@ -597,7 +607,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
597
607
|
}
|
|
598
608
|
function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
|
|
599
609
|
let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
|
|
600
|
-
let walker =
|
|
610
|
+
let walker = (0, $6nfFC$getOwnerDocument)(root).createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
601
611
|
acceptNode (node) {
|
|
602
612
|
var _opts_from;
|
|
603
613
|
// Skip nodes inside the starting node.
|
|
@@ -615,7 +625,7 @@ function $9bf71ea28793e738$export$c5251b9e124bf29(ref, defaultOptions = {}) {
|
|
|
615
625
|
let root = ref.current;
|
|
616
626
|
if (!root) return null;
|
|
617
627
|
let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
|
|
618
|
-
let node = from ||
|
|
628
|
+
let node = from || (0, $6nfFC$getOwnerDocument)(root).activeElement;
|
|
619
629
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {
|
|
620
630
|
tabbable: tabbable,
|
|
621
631
|
accept: accept
|
|
@@ -633,7 +643,7 @@ function $9bf71ea28793e738$export$c5251b9e124bf29(ref, defaultOptions = {}) {
|
|
|
633
643
|
let root = ref.current;
|
|
634
644
|
if (!root) return null;
|
|
635
645
|
let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
|
|
636
|
-
let node = from ||
|
|
646
|
+
let node = from || (0, $6nfFC$getOwnerDocument)(root).activeElement;
|
|
637
647
|
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {
|
|
638
648
|
tabbable: tabbable,
|
|
639
649
|
accept: accept
|