@react-aria/focus 3.17.0 → 3.17.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/FocusRing.main.js +2 -2
- package/dist/FocusRing.mjs +3 -3
- package/dist/FocusRing.module.js +2 -2
- package/dist/FocusScope.main.js +36 -36
- package/dist/FocusScope.mjs +37 -37
- package/dist/FocusScope.module.js +36 -36
- package/dist/focusSafely.main.js +1 -1
- package/dist/focusSafely.mjs +2 -2
- package/dist/focusSafely.module.js +1 -1
- package/dist/isElementVisible.main.js +5 -5
- package/dist/isElementVisible.mjs +6 -6
- package/dist/isElementVisible.module.js +5 -5
- package/dist/useFocusRing.mjs +1 -1
- package/dist/useFocusable.mjs +1 -1
- package/dist/useHasTabbableChild.main.js +2 -2
- package/dist/useHasTabbableChild.mjs +3 -3
- package/dist/useHasTabbableChild.module.js +2 -2
- package/package.json +5 -5
package/dist/FocusRing.main.js
CHANGED
|
@@ -34,8 +34,8 @@ function $dfd8c70b928eb1b3$export$1a38b4ad7f578e1d(props) {
|
|
|
34
34
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($hE1Ku$react))).cloneElement(child, (0, $hE1Ku$reactariautils.mergeProps)(child.props, {
|
|
35
35
|
...focusProps,
|
|
36
36
|
className: (0, ($parcel$interopDefault($hE1Ku$clsx)))({
|
|
37
|
-
[focusClass ||
|
|
38
|
-
[focusRingClass ||
|
|
37
|
+
[focusClass || '']: isFocused,
|
|
38
|
+
[focusRingClass || '']: isFocusVisible
|
|
39
39
|
})
|
|
40
40
|
}));
|
|
41
41
|
}
|
package/dist/FocusRing.mjs
CHANGED
|
@@ -24,12 +24,12 @@ function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
|
|
|
24
24
|
return /*#__PURE__*/ (0, $hAmeg$react).cloneElement(child, (0, $hAmeg$mergeProps)(child.props, {
|
|
25
25
|
...focusProps,
|
|
26
26
|
className: (0, $hAmeg$clsx)({
|
|
27
|
-
[focusClass ||
|
|
28
|
-
[focusRingClass ||
|
|
27
|
+
[focusClass || '']: isFocused,
|
|
28
|
+
[focusRingClass || '']: isFocusVisible
|
|
29
29
|
})
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
export {$907718708eab68af$export$1a38b4ad7f578e1d as FocusRing};
|
|
35
|
-
//# sourceMappingURL=FocusRing.
|
|
35
|
+
//# sourceMappingURL=FocusRing.module.js.map
|
package/dist/FocusRing.module.js
CHANGED
|
@@ -24,8 +24,8 @@ function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
|
|
|
24
24
|
return /*#__PURE__*/ (0, $hAmeg$react).cloneElement(child, (0, $hAmeg$mergeProps)(child.props, {
|
|
25
25
|
...focusProps,
|
|
26
26
|
className: (0, $hAmeg$clsx)({
|
|
27
|
-
[focusClass ||
|
|
28
|
-
[focusRingClass ||
|
|
27
|
+
[focusClass || '']: isFocused,
|
|
28
|
+
[focusRingClass || '']: isFocusVisible
|
|
29
29
|
})
|
|
30
30
|
}));
|
|
31
31
|
}
|
package/dist/FocusScope.main.js
CHANGED
|
@@ -207,21 +207,21 @@ function $a7a032acae3ddda9$var$createFocusManagerForScope(scopeRef) {
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
const $a7a032acae3ddda9$var$focusableElements = [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
210
|
+
'input:not([disabled]):not([type=hidden])',
|
|
211
|
+
'select:not([disabled])',
|
|
212
|
+
'textarea:not([disabled])',
|
|
213
|
+
'button:not([disabled])',
|
|
214
|
+
'a[href]',
|
|
215
|
+
'area[href]',
|
|
216
|
+
'summary',
|
|
217
|
+
'iframe',
|
|
218
|
+
'object',
|
|
219
|
+
'embed',
|
|
220
|
+
'audio[controls]',
|
|
221
|
+
'video[controls]',
|
|
222
|
+
'[contenteditable]'
|
|
223
223
|
];
|
|
224
|
-
const $a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(
|
|
224
|
+
const $a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
|
|
225
225
|
$a7a032acae3ddda9$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
226
226
|
const $a7a032acae3ddda9$var$TABBABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
227
227
|
function $a7a032acae3ddda9$export$4c063cf1350e6fed(element) {
|
|
@@ -254,7 +254,7 @@ function $a7a032acae3ddda9$var$useFocusContainment(scopeRef, contain) {
|
|
|
254
254
|
const ownerDocument = (0, $euGna$reactariautils.getOwnerDocument)(scope ? scope[0] : undefined);
|
|
255
255
|
// Handle the Tab key to contain focus within the scope
|
|
256
256
|
let onKeyDown = (e)=>{
|
|
257
|
-
if (e.key !==
|
|
257
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$a7a032acae3ddda9$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
258
258
|
let focusedElement = ownerDocument.activeElement;
|
|
259
259
|
let scope = scopeRef.current;
|
|
260
260
|
if (!scope || !$a7a032acae3ddda9$var$isElementInScope(focusedElement, scope)) return;
|
|
@@ -300,15 +300,15 @@ function $a7a032acae3ddda9$var$useFocusContainment(scopeRef, contain) {
|
|
|
300
300
|
}
|
|
301
301
|
});
|
|
302
302
|
};
|
|
303
|
-
ownerDocument.addEventListener(
|
|
304
|
-
ownerDocument.addEventListener(
|
|
305
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
306
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
303
|
+
ownerDocument.addEventListener('keydown', onKeyDown, false);
|
|
304
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
305
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
306
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));
|
|
307
307
|
return ()=>{
|
|
308
|
-
ownerDocument.removeEventListener(
|
|
309
|
-
ownerDocument.removeEventListener(
|
|
310
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
311
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
308
|
+
ownerDocument.removeEventListener('keydown', onKeyDown, false);
|
|
309
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
310
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
311
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));
|
|
312
312
|
};
|
|
313
313
|
}, [
|
|
314
314
|
scopeRef,
|
|
@@ -334,7 +334,7 @@ function $a7a032acae3ddda9$var$isElementInScope(element, scope) {
|
|
|
334
334
|
}
|
|
335
335
|
function $a7a032acae3ddda9$var$isElementInChildScope(element, scope = null) {
|
|
336
336
|
// If the element is within a top layer element (e.g. toasts), always allow moving focus there.
|
|
337
|
-
if (element instanceof Element && element.closest(
|
|
337
|
+
if (element instanceof Element && element.closest('[data-react-aria-top-layer]')) return true;
|
|
338
338
|
// node.contains in isElementInScope covers child scopes that are also DOM children,
|
|
339
339
|
// but does not cover child scopes in portals.
|
|
340
340
|
for (let { scopeRef: s } of $a7a032acae3ddda9$export$d06fae2ee68b101e.traverse($a7a032acae3ddda9$export$d06fae2ee68b101e.getTreeNode(scope))){
|
|
@@ -410,11 +410,11 @@ function $a7a032acae3ddda9$var$useActiveScopeTracker(scopeRef, restore, contain)
|
|
|
410
410
|
if ($a7a032acae3ddda9$var$isElementInScope(target, scopeRef.current)) $a7a032acae3ddda9$var$activeScope = scopeRef;
|
|
411
411
|
else if (!$a7a032acae3ddda9$var$isElementInAnyScope(target)) $a7a032acae3ddda9$var$activeScope = null;
|
|
412
412
|
};
|
|
413
|
-
ownerDocument.addEventListener(
|
|
414
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
413
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
414
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
415
415
|
return ()=>{
|
|
416
|
-
ownerDocument.removeEventListener(
|
|
417
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
416
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
417
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
418
418
|
};
|
|
419
419
|
}, [
|
|
420
420
|
scopeRef,
|
|
@@ -433,7 +433,7 @@ function $a7a032acae3ddda9$var$shouldRestoreFocus(scopeRef) {
|
|
|
433
433
|
function $a7a032acae3ddda9$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
|
|
434
434
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
435
435
|
// eslint-disable-next-line no-restricted-globals
|
|
436
|
-
const nodeToRestoreRef = (0, $euGna$react.useRef)(typeof document !==
|
|
436
|
+
const nodeToRestoreRef = (0, $euGna$react.useRef)(typeof document !== 'undefined' ? (0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
|
|
437
437
|
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus
|
|
438
438
|
// restoring-non-containing scopes should only care if they become active so they can perform the restore
|
|
439
439
|
(0, $euGna$reactariautils.useLayoutEffect)(()=>{
|
|
@@ -445,11 +445,11 @@ function $a7a032acae3ddda9$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
445
445
|
// Moving out of the active scope to an ancestor is not allowed.
|
|
446
446
|
if ((!$a7a032acae3ddda9$var$activeScope || $a7a032acae3ddda9$var$isAncestorScope($a7a032acae3ddda9$var$activeScope, scopeRef)) && $a7a032acae3ddda9$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $a7a032acae3ddda9$var$activeScope = scopeRef;
|
|
447
447
|
};
|
|
448
|
-
ownerDocument.addEventListener(
|
|
449
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
448
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
449
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
450
450
|
return ()=>{
|
|
451
|
-
ownerDocument.removeEventListener(
|
|
452
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
451
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
452
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
453
453
|
};
|
|
454
454
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
455
455
|
}, [
|
|
@@ -464,7 +464,7 @@ function $a7a032acae3ddda9$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
464
464
|
// using portals for overlays, so that focus goes to the expected element when
|
|
465
465
|
// tabbing out of the overlay.
|
|
466
466
|
let onKeyDown = (e)=>{
|
|
467
|
-
if (e.key !==
|
|
467
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$a7a032acae3ddda9$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
468
468
|
let focusedElement = ownerDocument.activeElement;
|
|
469
469
|
if (!$a7a032acae3ddda9$var$isElementInScope(focusedElement, scopeRef.current)) return;
|
|
470
470
|
let treeNode = $a7a032acae3ddda9$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
@@ -498,9 +498,9 @@ function $a7a032acae3ddda9$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
498
498
|
else $a7a032acae3ddda9$var$focusElement(nodeToRestore, true);
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
|
-
if (!contain) ownerDocument.addEventListener(
|
|
501
|
+
if (!contain) ownerDocument.addEventListener('keydown', onKeyDown, true);
|
|
502
502
|
return ()=>{
|
|
503
|
-
if (!contain) ownerDocument.removeEventListener(
|
|
503
|
+
if (!contain) ownerDocument.removeEventListener('keydown', onKeyDown, true);
|
|
504
504
|
};
|
|
505
505
|
}, [
|
|
506
506
|
scopeRef,
|
package/dist/FocusScope.mjs
CHANGED
|
@@ -192,21 +192,21 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
const $9bf71ea28793e738$var$focusableElements = [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
195
|
+
'input:not([disabled]):not([type=hidden])',
|
|
196
|
+
'select:not([disabled])',
|
|
197
|
+
'textarea:not([disabled])',
|
|
198
|
+
'button:not([disabled])',
|
|
199
|
+
'a[href]',
|
|
200
|
+
'area[href]',
|
|
201
|
+
'summary',
|
|
202
|
+
'iframe',
|
|
203
|
+
'object',
|
|
204
|
+
'embed',
|
|
205
|
+
'audio[controls]',
|
|
206
|
+
'video[controls]',
|
|
207
|
+
'[contenteditable]'
|
|
208
208
|
];
|
|
209
|
-
const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(
|
|
209
|
+
const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
|
|
210
210
|
$9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
211
211
|
const $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
212
212
|
function $9bf71ea28793e738$export$4c063cf1350e6fed(element) {
|
|
@@ -239,7 +239,7 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
239
239
|
const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);
|
|
240
240
|
// Handle the Tab key to contain focus within the scope
|
|
241
241
|
let onKeyDown = (e)=>{
|
|
242
|
-
if (e.key !==
|
|
242
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
243
243
|
let focusedElement = ownerDocument.activeElement;
|
|
244
244
|
let scope = scopeRef.current;
|
|
245
245
|
if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;
|
|
@@ -285,15 +285,15 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
|
-
ownerDocument.addEventListener(
|
|
289
|
-
ownerDocument.addEventListener(
|
|
290
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
291
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
288
|
+
ownerDocument.addEventListener('keydown', onKeyDown, false);
|
|
289
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
290
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
291
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));
|
|
292
292
|
return ()=>{
|
|
293
|
-
ownerDocument.removeEventListener(
|
|
294
|
-
ownerDocument.removeEventListener(
|
|
295
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
296
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
293
|
+
ownerDocument.removeEventListener('keydown', onKeyDown, false);
|
|
294
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
295
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
296
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));
|
|
297
297
|
};
|
|
298
298
|
}, [
|
|
299
299
|
scopeRef,
|
|
@@ -319,7 +319,7 @@ function $9bf71ea28793e738$var$isElementInScope(element, scope) {
|
|
|
319
319
|
}
|
|
320
320
|
function $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {
|
|
321
321
|
// If the element is within a top layer element (e.g. toasts), always allow moving focus there.
|
|
322
|
-
if (element instanceof Element && element.closest(
|
|
322
|
+
if (element instanceof Element && element.closest('[data-react-aria-top-layer]')) return true;
|
|
323
323
|
// node.contains in isElementInScope covers child scopes that are also DOM children,
|
|
324
324
|
// but does not cover child scopes in portals.
|
|
325
325
|
for (let { scopeRef: s } of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope))){
|
|
@@ -395,11 +395,11 @@ function $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain)
|
|
|
395
395
|
if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
396
396
|
else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;
|
|
397
397
|
};
|
|
398
|
-
ownerDocument.addEventListener(
|
|
399
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
398
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
399
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
400
400
|
return ()=>{
|
|
401
|
-
ownerDocument.removeEventListener(
|
|
402
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
401
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
402
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
403
403
|
};
|
|
404
404
|
}, [
|
|
405
405
|
scopeRef,
|
|
@@ -418,7 +418,7 @@ function $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {
|
|
|
418
418
|
function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
|
|
419
419
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
420
420
|
// eslint-disable-next-line no-restricted-globals
|
|
421
|
-
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !==
|
|
421
|
+
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
|
|
422
422
|
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus
|
|
423
423
|
// restoring-non-containing scopes should only care if they become active so they can perform the restore
|
|
424
424
|
(0, $cgawC$useLayoutEffect)(()=>{
|
|
@@ -430,11 +430,11 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
430
430
|
// Moving out of the active scope to an ancestor is not allowed.
|
|
431
431
|
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
432
432
|
};
|
|
433
|
-
ownerDocument.addEventListener(
|
|
434
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
433
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
434
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
435
435
|
return ()=>{
|
|
436
|
-
ownerDocument.removeEventListener(
|
|
437
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
436
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
437
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
438
438
|
};
|
|
439
439
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
440
440
|
}, [
|
|
@@ -449,7 +449,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
449
449
|
// using portals for overlays, so that focus goes to the expected element when
|
|
450
450
|
// tabbing out of the overlay.
|
|
451
451
|
let onKeyDown = (e)=>{
|
|
452
|
-
if (e.key !==
|
|
452
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
453
453
|
let focusedElement = ownerDocument.activeElement;
|
|
454
454
|
if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scopeRef.current)) return;
|
|
455
455
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
@@ -483,9 +483,9 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
483
483
|
else $9bf71ea28793e738$var$focusElement(nodeToRestore, true);
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
|
-
if (!contain) ownerDocument.addEventListener(
|
|
486
|
+
if (!contain) ownerDocument.addEventListener('keydown', onKeyDown, true);
|
|
487
487
|
return ()=>{
|
|
488
|
-
if (!contain) ownerDocument.removeEventListener(
|
|
488
|
+
if (!contain) ownerDocument.removeEventListener('keydown', onKeyDown, true);
|
|
489
489
|
};
|
|
490
490
|
}, [
|
|
491
491
|
scopeRef,
|
|
@@ -711,4 +711,4 @@ let $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree()
|
|
|
711
711
|
|
|
712
712
|
|
|
713
713
|
export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$d06fae2ee68b101e as focusScopeTree, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$4c063cf1350e6fed as isFocusable, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager};
|
|
714
|
-
//# sourceMappingURL=FocusScope.
|
|
714
|
+
//# sourceMappingURL=FocusScope.module.js.map
|
|
@@ -192,21 +192,21 @@ function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
|
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
const $9bf71ea28793e738$var$focusableElements = [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
195
|
+
'input:not([disabled]):not([type=hidden])',
|
|
196
|
+
'select:not([disabled])',
|
|
197
|
+
'textarea:not([disabled])',
|
|
198
|
+
'button:not([disabled])',
|
|
199
|
+
'a[href]',
|
|
200
|
+
'area[href]',
|
|
201
|
+
'summary',
|
|
202
|
+
'iframe',
|
|
203
|
+
'object',
|
|
204
|
+
'embed',
|
|
205
|
+
'audio[controls]',
|
|
206
|
+
'video[controls]',
|
|
207
|
+
'[contenteditable]'
|
|
208
208
|
];
|
|
209
|
-
const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(
|
|
209
|
+
const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
|
|
210
210
|
$9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
211
211
|
const $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
212
212
|
function $9bf71ea28793e738$export$4c063cf1350e6fed(element) {
|
|
@@ -239,7 +239,7 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
239
239
|
const ownerDocument = (0, $cgawC$getOwnerDocument)(scope ? scope[0] : undefined);
|
|
240
240
|
// Handle the Tab key to contain focus within the scope
|
|
241
241
|
let onKeyDown = (e)=>{
|
|
242
|
-
if (e.key !==
|
|
242
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
243
243
|
let focusedElement = ownerDocument.activeElement;
|
|
244
244
|
let scope = scopeRef.current;
|
|
245
245
|
if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;
|
|
@@ -285,15 +285,15 @@ function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
|
-
ownerDocument.addEventListener(
|
|
289
|
-
ownerDocument.addEventListener(
|
|
290
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
291
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
288
|
+
ownerDocument.addEventListener('keydown', onKeyDown, false);
|
|
289
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
290
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
291
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusout', onBlur, false));
|
|
292
292
|
return ()=>{
|
|
293
|
-
ownerDocument.removeEventListener(
|
|
294
|
-
ownerDocument.removeEventListener(
|
|
295
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
296
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
293
|
+
ownerDocument.removeEventListener('keydown', onKeyDown, false);
|
|
294
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
295
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
296
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusout', onBlur, false));
|
|
297
297
|
};
|
|
298
298
|
}, [
|
|
299
299
|
scopeRef,
|
|
@@ -319,7 +319,7 @@ function $9bf71ea28793e738$var$isElementInScope(element, scope) {
|
|
|
319
319
|
}
|
|
320
320
|
function $9bf71ea28793e738$var$isElementInChildScope(element, scope = null) {
|
|
321
321
|
// If the element is within a top layer element (e.g. toasts), always allow moving focus there.
|
|
322
|
-
if (element instanceof Element && element.closest(
|
|
322
|
+
if (element instanceof Element && element.closest('[data-react-aria-top-layer]')) return true;
|
|
323
323
|
// node.contains in isElementInScope covers child scopes that are also DOM children,
|
|
324
324
|
// but does not cover child scopes in portals.
|
|
325
325
|
for (let { scopeRef: s } of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope))){
|
|
@@ -395,11 +395,11 @@ function $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain)
|
|
|
395
395
|
if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
396
396
|
else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;
|
|
397
397
|
};
|
|
398
|
-
ownerDocument.addEventListener(
|
|
399
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
398
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
399
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
400
400
|
return ()=>{
|
|
401
|
-
ownerDocument.removeEventListener(
|
|
402
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
401
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
402
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
403
403
|
};
|
|
404
404
|
}, [
|
|
405
405
|
scopeRef,
|
|
@@ -418,7 +418,7 @@ function $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {
|
|
|
418
418
|
function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
|
|
419
419
|
// create a ref during render instead of useLayoutEffect so the active element is saved before a child with autoFocus=true mounts.
|
|
420
420
|
// eslint-disable-next-line no-restricted-globals
|
|
421
|
-
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !==
|
|
421
|
+
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
|
|
422
422
|
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus
|
|
423
423
|
// restoring-non-containing scopes should only care if they become active so they can perform the restore
|
|
424
424
|
(0, $cgawC$useLayoutEffect)(()=>{
|
|
@@ -430,11 +430,11 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
430
430
|
// Moving out of the active scope to an ancestor is not allowed.
|
|
431
431
|
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
|
|
432
432
|
};
|
|
433
|
-
ownerDocument.addEventListener(
|
|
434
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener(
|
|
433
|
+
ownerDocument.addEventListener('focusin', onFocus, false);
|
|
434
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.addEventListener('focusin', onFocus, false));
|
|
435
435
|
return ()=>{
|
|
436
|
-
ownerDocument.removeEventListener(
|
|
437
|
-
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener(
|
|
436
|
+
ownerDocument.removeEventListener('focusin', onFocus, false);
|
|
437
|
+
scope === null || scope === void 0 ? void 0 : scope.forEach((element)=>element.removeEventListener('focusin', onFocus, false));
|
|
438
438
|
};
|
|
439
439
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
440
440
|
}, [
|
|
@@ -449,7 +449,7 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
449
449
|
// using portals for overlays, so that focus goes to the expected element when
|
|
450
450
|
// tabbing out of the overlay.
|
|
451
451
|
let onKeyDown = (e)=>{
|
|
452
|
-
if (e.key !==
|
|
452
|
+
if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
|
|
453
453
|
let focusedElement = ownerDocument.activeElement;
|
|
454
454
|
if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scopeRef.current)) return;
|
|
455
455
|
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
|
|
@@ -483,9 +483,9 @@ function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain)
|
|
|
483
483
|
else $9bf71ea28793e738$var$focusElement(nodeToRestore, true);
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
|
-
if (!contain) ownerDocument.addEventListener(
|
|
486
|
+
if (!contain) ownerDocument.addEventListener('keydown', onKeyDown, true);
|
|
487
487
|
return ()=>{
|
|
488
|
-
if (!contain) ownerDocument.removeEventListener(
|
|
488
|
+
if (!contain) ownerDocument.removeEventListener('keydown', onKeyDown, true);
|
|
489
489
|
};
|
|
490
490
|
}, [
|
|
491
491
|
scopeRef,
|
package/dist/focusSafely.main.js
CHANGED
|
@@ -26,7 +26,7 @@ function $1c7f9157d722357d$export$80f3e147d781571c(element) {
|
|
|
26
26
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
27
27
|
// from off the screen.
|
|
28
28
|
const ownerDocument = (0, $cBYLt$reactariautils.getOwnerDocument)(element);
|
|
29
|
-
if ((0, $cBYLt$reactariainteractions.getInteractionModality)() ===
|
|
29
|
+
if ((0, $cBYLt$reactariainteractions.getInteractionModality)() === 'virtual') {
|
|
30
30
|
let lastFocusedElement = ownerDocument.activeElement;
|
|
31
31
|
(0, $cBYLt$reactariautils.runAfterTransition)(()=>{
|
|
32
32
|
// If focus did not move and the element is still in the document, focus it.
|
package/dist/focusSafely.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
|
20
20
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
21
21
|
// from off the screen.
|
|
22
22
|
const ownerDocument = (0, $jlOai$getOwnerDocument)(element);
|
|
23
|
-
if ((0, $jlOai$getInteractionModality)() ===
|
|
23
|
+
if ((0, $jlOai$getInteractionModality)() === 'virtual') {
|
|
24
24
|
let lastFocusedElement = ownerDocument.activeElement;
|
|
25
25
|
(0, $jlOai$runAfterTransition)(()=>{
|
|
26
26
|
// If focus did not move and the element is still in the document, focus it.
|
|
@@ -31,4 +31,4 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
export {$6a99195332edec8b$export$80f3e147d781571c as focusSafely};
|
|
34
|
-
//# sourceMappingURL=focusSafely.
|
|
34
|
+
//# sourceMappingURL=focusSafely.module.js.map
|
|
@@ -20,7 +20,7 @@ function $6a99195332edec8b$export$80f3e147d781571c(element) {
|
|
|
20
20
|
// causing the page to scroll when moving focus if the element is transitioning
|
|
21
21
|
// from off the screen.
|
|
22
22
|
const ownerDocument = (0, $jlOai$getOwnerDocument)(element);
|
|
23
|
-
if ((0, $jlOai$getInteractionModality)() ===
|
|
23
|
+
if ((0, $jlOai$getInteractionModality)() === 'virtual') {
|
|
24
24
|
let lastFocusedElement = ownerDocument.activeElement;
|
|
25
25
|
(0, $jlOai$runAfterTransition)(()=>{
|
|
26
26
|
// If focus did not move and the element is still in the document, focus it.
|
|
@@ -21,20 +21,20 @@ function $d5156037ad898a4d$var$isStyleVisible(element) {
|
|
|
21
21
|
const windowObject = (0, $fhpU6$reactariautils.getOwnerWindow)(element);
|
|
22
22
|
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
|
|
23
23
|
let { display: display, visibility: visibility } = element.style;
|
|
24
|
-
let isVisible = display !==
|
|
24
|
+
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
|
|
25
25
|
if (isVisible) {
|
|
26
26
|
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
|
|
27
27
|
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
|
|
28
|
-
isVisible = computedDisplay !==
|
|
28
|
+
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
|
|
29
29
|
}
|
|
30
30
|
return isVisible;
|
|
31
31
|
}
|
|
32
32
|
function $d5156037ad898a4d$var$isAttributeVisible(element, childElement) {
|
|
33
|
-
return !element.hasAttribute(
|
|
34
|
-
!element.hasAttribute(
|
|
33
|
+
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
|
|
34
|
+
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
35
35
|
}
|
|
36
36
|
function $d5156037ad898a4d$export$e989c0fffaa6b27a(element, childElement) {
|
|
37
|
-
return element.nodeName !==
|
|
37
|
+
return element.nodeName !== '#comment' && $d5156037ad898a4d$var$isStyleVisible(element) && $d5156037ad898a4d$var$isAttributeVisible(element, childElement) && (!element.parentElement || $d5156037ad898a4d$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
|
|
@@ -15,22 +15,22 @@ function $645f2e67b85a24c9$var$isStyleVisible(element) {
|
|
|
15
15
|
const windowObject = (0, $djhjW$getOwnerWindow)(element);
|
|
16
16
|
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
|
|
17
17
|
let { display: display, visibility: visibility } = element.style;
|
|
18
|
-
let isVisible = display !==
|
|
18
|
+
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
|
|
19
19
|
if (isVisible) {
|
|
20
20
|
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
|
|
21
21
|
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
|
|
22
|
-
isVisible = computedDisplay !==
|
|
22
|
+
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
|
|
23
23
|
}
|
|
24
24
|
return isVisible;
|
|
25
25
|
}
|
|
26
26
|
function $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) {
|
|
27
|
-
return !element.hasAttribute(
|
|
28
|
-
!element.hasAttribute(
|
|
27
|
+
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
|
|
28
|
+
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
29
29
|
}
|
|
30
30
|
function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
|
|
31
|
-
return element.nodeName !==
|
|
31
|
+
return element.nodeName !== '#comment' && $645f2e67b85a24c9$var$isStyleVisible(element) && $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) && (!element.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
export {$645f2e67b85a24c9$export$e989c0fffaa6b27a as isElementVisible};
|
|
36
|
-
//# sourceMappingURL=isElementVisible.
|
|
36
|
+
//# sourceMappingURL=isElementVisible.module.js.map
|
|
@@ -15,20 +15,20 @@ function $645f2e67b85a24c9$var$isStyleVisible(element) {
|
|
|
15
15
|
const windowObject = (0, $djhjW$getOwnerWindow)(element);
|
|
16
16
|
if (!(element instanceof windowObject.HTMLElement) && !(element instanceof windowObject.SVGElement)) return false;
|
|
17
17
|
let { display: display, visibility: visibility } = element.style;
|
|
18
|
-
let isVisible = display !==
|
|
18
|
+
let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
|
|
19
19
|
if (isVisible) {
|
|
20
20
|
const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
|
|
21
21
|
let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
|
|
22
|
-
isVisible = computedDisplay !==
|
|
22
|
+
isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
|
|
23
23
|
}
|
|
24
24
|
return isVisible;
|
|
25
25
|
}
|
|
26
26
|
function $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) {
|
|
27
|
-
return !element.hasAttribute(
|
|
28
|
-
!element.hasAttribute(
|
|
27
|
+
return !element.hasAttribute('hidden') && // Ignore HiddenSelect when tree walking.
|
|
28
|
+
!element.hasAttribute('data-react-aria-prevent-focus') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
|
|
29
29
|
}
|
|
30
30
|
function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
|
|
31
|
-
return element.nodeName !==
|
|
31
|
+
return element.nodeName !== '#comment' && $645f2e67b85a24c9$var$isStyleVisible(element) && $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) && (!element.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element.parentElement, element));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
package/dist/useFocusRing.mjs
CHANGED
package/dist/useFocusable.mjs
CHANGED
|
@@ -62,4 +62,4 @@ function $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, domRef) {
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
export {$e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 as FocusableProvider, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c as useFocusable};
|
|
65
|
-
//# sourceMappingURL=useFocusable.
|
|
65
|
+
//# sourceMappingURL=useFocusable.module.js.map
|
|
@@ -36,8 +36,8 @@ function $83013635b024ae3d$export$eac1895992b9f3d6(ref, options) {
|
|
|
36
36
|
childList: true,
|
|
37
37
|
attributes: true,
|
|
38
38
|
attributeFilter: [
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
'tabIndex',
|
|
40
|
+
'disabled'
|
|
41
41
|
]
|
|
42
42
|
});
|
|
43
43
|
return ()=>{
|
|
@@ -54,4 +54,4 @@ function $83013635b024ae3d$export$eac1895992b9f3d6(ref, options) {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
export {$83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild};
|
|
57
|
-
//# sourceMappingURL=useHasTabbableChild.
|
|
57
|
+
//# sourceMappingURL=useHasTabbableChild.module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/focus",
|
|
3
|
-
"version": "3.17.
|
|
3
|
+
"version": "3.17.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/interactions": "^3.21.
|
|
26
|
-
"@react-aria/utils": "^3.24.
|
|
27
|
-
"@react-types/shared": "^3.23.
|
|
25
|
+
"@react-aria/interactions": "^3.21.3",
|
|
26
|
+
"@react-aria/utils": "^3.24.1",
|
|
27
|
+
"@react-types/shared": "^3.23.1",
|
|
28
28
|
"@swc/helpers": "^0.5.0",
|
|
29
29
|
"clsx": "^2.0.0"
|
|
30
30
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
38
38
|
}
|