New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-aria/focus

Package Overview
Dependencies
Maintainers
2
Versions
901
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/focus - npm Package Compare versions

Comparing version 3.0.0-nightly-4980928d3-240906 to 3.0.0-nightly-4b8b33a02-250211

5

dist/focusSafely.main.js

@@ -29,7 +29,8 @@ var $cBYLt$reactariautils = require("@react-aria/utils");

const ownerDocument = (0, $cBYLt$reactariautils.getOwnerDocument)(element);
const activeElement = (0, $cBYLt$reactariautils.getActiveElement)(ownerDocument);
if ((0, $cBYLt$reactariainteractions.getInteractionModality)() === 'virtual') {
let lastFocusedElement = ownerDocument.activeElement;
let lastFocusedElement = activeElement;
(0, $cBYLt$reactariautils.runAfterTransition)(()=>{
// If focus did not move and the element is still in the document, focus it.
if (ownerDocument.activeElement === lastFocusedElement && element.isConnected) (0, $cBYLt$reactariautils.focusWithoutScrolling)(element);
if ((0, $cBYLt$reactariautils.getActiveElement)(ownerDocument) === lastFocusedElement && element.isConnected) (0, $cBYLt$reactariautils.focusWithoutScrolling)(element);
});

@@ -36,0 +37,0 @@ } else (0, $cBYLt$reactariautils.focusWithoutScrolling)(element);

7

dist/focusSafely.module.js

@@ -1,2 +0,2 @@

import {getOwnerDocument as $jlOai$getOwnerDocument, runAfterTransition as $jlOai$runAfterTransition, focusWithoutScrolling as $jlOai$focusWithoutScrolling} from "@react-aria/utils";
import {getOwnerDocument as $jlOai$getOwnerDocument, getActiveElement as $jlOai$getActiveElement, runAfterTransition as $jlOai$runAfterTransition, focusWithoutScrolling as $jlOai$focusWithoutScrolling} from "@react-aria/utils";
import {getInteractionModality as $jlOai$getInteractionModality} from "@react-aria/interactions";

@@ -23,7 +23,8 @@

const ownerDocument = (0, $jlOai$getOwnerDocument)(element);
const activeElement = (0, $jlOai$getActiveElement)(ownerDocument);
if ((0, $jlOai$getInteractionModality)() === 'virtual') {
let lastFocusedElement = ownerDocument.activeElement;
let lastFocusedElement = activeElement;
(0, $jlOai$runAfterTransition)(()=>{
// If focus did not move and the element is still in the document, focus it.
if (ownerDocument.activeElement === lastFocusedElement && element.isConnected) (0, $jlOai$focusWithoutScrolling)(element);
if ((0, $jlOai$getActiveElement)(ownerDocument) === lastFocusedElement && element.isConnected) (0, $jlOai$focusWithoutScrolling)(element);
});

@@ -30,0 +31,0 @@ } else (0, $jlOai$focusWithoutScrolling)(element);

var $1c7f9157d722357d$exports = require("./focusSafely.main.js");
var $d5156037ad898a4d$exports = require("./isElementVisible.main.js");
var $euGna$reactariautils = require("@react-aria/utils");
var $euGna$reactariainteractions = require("@react-aria/interactions");
var $euGna$react = require("react");

@@ -18,3 +19,2 @@

$parcel$export(module.exports, "getFocusableTreeWalker", () => $a7a032acae3ddda9$export$2d6ec8fc375ceafa);
$parcel$export(module.exports, "isFocusable", () => $a7a032acae3ddda9$export$4c063cf1350e6fed);
$parcel$export(module.exports, "isElementInChildOfActiveScope", () => $a7a032acae3ddda9$export$1258395f99bf9cbf);

@@ -36,2 +36,3 @@ $parcel$export(module.exports, "createFocusManager", () => $a7a032acae3ddda9$export$c5251b9e124bf29);

const $a7a032acae3ddda9$var$FocusContext = /*#__PURE__*/ (0, ($parcel$interopDefault($euGna$react))).createContext(null);

@@ -101,3 +102,3 @@ const $a7a032acae3ddda9$var$RESTORE_FOCUS_EVENT = 'react-aria-focus-scope-restore';

(0, $euGna$react.useEffect)(()=>{
const activeElement = (0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement;
const activeElement = (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined));
let scope = null;

@@ -156,3 +157,4 @@ if ($a7a032acae3ddda9$var$isElementInScope(activeElement, scopeRef.current)) {

let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
let node = from || (0, $euGna$reactariautils.getOwnerDocument)(scope[0]).activeElement;
var _scope_;
let node = from || (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
let sentinel = scope[0].previousElementSibling;

@@ -176,3 +178,4 @@ let scopeRoot = $a7a032acae3ddda9$var$getScopeRoot(scope);

let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
let node = from || (0, $euGna$reactariautils.getOwnerDocument)(scope[0]).activeElement;
var _scope_;
let node = from || (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
let sentinel = scope[scope.length - 1].nextElementSibling;

@@ -221,23 +224,2 @@ let scopeRoot = $a7a032acae3ddda9$var$getScopeRoot(scope);

}
const $a7a032acae3ddda9$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]'
];
const $a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$a7a032acae3ddda9$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $a7a032acae3ddda9$var$TABBABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $a7a032acae3ddda9$export$4c063cf1350e6fed(element) {
return element.matches($a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR);
}
function $a7a032acae3ddda9$var$getScopeRoot(scope) {

@@ -271,3 +253,3 @@ return scope[0].parentElement;

if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$a7a032acae3ddda9$var$shouldContainFocus(scopeRef) || e.isComposing) return;
let focusedElement = ownerDocument.activeElement;
let focusedElement = (0, $euGna$reactariautils.getActiveElement)(ownerDocument);
let scope = scopeRef.current;

@@ -292,6 +274,6 @@ if (!scope || !$a7a032acae3ddda9$var$isElementInScope(focusedElement, scope)) return;

// Moving out of the active scope to an ancestor is not allowed.
if ((!$a7a032acae3ddda9$var$activeScope || $a7a032acae3ddda9$var$isAncestorScope($a7a032acae3ddda9$var$activeScope, scopeRef)) && $a7a032acae3ddda9$var$isElementInScope(e.target, scopeRef.current)) {
if ((!$a7a032acae3ddda9$var$activeScope || $a7a032acae3ddda9$var$isAncestorScope($a7a032acae3ddda9$var$activeScope, scopeRef)) && $a7a032acae3ddda9$var$isElementInScope((0, $euGna$reactariautils.getEventTarget)(e), scopeRef.current)) {
$a7a032acae3ddda9$var$activeScope = scopeRef;
focusedNode.current = e.target;
} else if ($a7a032acae3ddda9$var$shouldContainFocus(scopeRef) && !$a7a032acae3ddda9$var$isElementInChildScope(e.target, scopeRef)) {
focusedNode.current = (0, $euGna$reactariautils.getEventTarget)(e);
} else if ($a7a032acae3ddda9$var$shouldContainFocus(scopeRef) && !$a7a032acae3ddda9$var$isElementInChildScope((0, $euGna$reactariautils.getEventTarget)(e), scopeRef)) {
// If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),

@@ -301,3 +283,3 @@ // restore focus to the previously focused node or the first tabbable element in the active scope.

else if ($a7a032acae3ddda9$var$activeScope && $a7a032acae3ddda9$var$activeScope.current) $a7a032acae3ddda9$var$focusFirstInScope($a7a032acae3ddda9$var$activeScope.current);
} else if ($a7a032acae3ddda9$var$shouldContainFocus(scopeRef)) focusedNode.current = e.target;
} else if ($a7a032acae3ddda9$var$shouldContainFocus(scopeRef)) focusedNode.current = (0, $euGna$reactariautils.getEventTarget)(e);
};

@@ -308,8 +290,15 @@ let onBlur = (e)=>{

raf.current = requestAnimationFrame(()=>{
// Patches infinite focus coersion loop for Android Talkback where the user isn't able to move the virtual cursor
// if within a containing focus scope. Bug filed against Chrome: https://issuetracker.google.com/issues/384844019.
// Note that this means focus can leave focus containing modals due to this, but it is isolated to Chrome Talkback.
let modality = (0, $euGna$reactariainteractions.getInteractionModality)();
let shouldSkipFocusRestore = (modality === 'virtual' || modality === null) && (0, $euGna$reactariautils.isAndroid)() && (0, $euGna$reactariautils.isChrome)();
// Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe
if (ownerDocument.activeElement && $a7a032acae3ddda9$var$shouldContainFocus(scopeRef) && !$a7a032acae3ddda9$var$isElementInChildScope(ownerDocument.activeElement, scopeRef)) {
let activeElement = (0, $euGna$reactariautils.getActiveElement)(ownerDocument);
if (!shouldSkipFocusRestore && activeElement && $a7a032acae3ddda9$var$shouldContainFocus(scopeRef) && !$a7a032acae3ddda9$var$isElementInChildScope(activeElement, scopeRef)) {
$a7a032acae3ddda9$var$activeScope = scopeRef;
if (ownerDocument.body.contains(e.target)) {
let target = (0, $euGna$reactariautils.getEventTarget)(e);
if (target && target.isConnected) {
var _focusedNode_current;
focusedNode.current = e.target;
focusedNode.current = target;
(_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();

@@ -335,3 +324,2 @@ } else if ($a7a032acae3ddda9$var$activeScope.current) $a7a032acae3ddda9$var$focusFirstInScope($a7a032acae3ddda9$var$activeScope.current);

// This is a useLayoutEffect so it is guaranteed to run before our async synthetic blur
// eslint-disable-next-line arrow-body-style
(0, $euGna$reactariautils.useLayoutEffect)(()=>{

@@ -378,3 +366,3 @@ return ()=>{

(0, $1c7f9157d722357d$exports.focusSafely)(element);
} catch (err) {
} catch {
// ignore

@@ -384,3 +372,3 @@ }

element.focus();
} catch (err) {
} catch {
// ignore

@@ -417,3 +405,3 @@ }

const ownerDocument = (0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);
if (!$a7a032acae3ddda9$var$isElementInScope(ownerDocument.activeElement, $a7a032acae3ddda9$var$activeScope.current) && scopeRef.current) $a7a032acae3ddda9$var$focusFirstInScope(scopeRef.current);
if (!$a7a032acae3ddda9$var$isElementInScope((0, $euGna$reactariautils.getActiveElement)(ownerDocument), $a7a032acae3ddda9$var$activeScope.current) && scopeRef.current) $a7a032acae3ddda9$var$focusFirstInScope(scopeRef.current);
}

@@ -433,3 +421,3 @@ autoFocusRef.current = false;

let onFocus = (e)=>{
let target = e.target;
let target = (0, $euGna$reactariautils.getEventTarget)(e);
if ($a7a032acae3ddda9$var$isElementInScope(target, scopeRef.current)) $a7a032acae3ddda9$var$activeScope = scopeRef;

@@ -461,3 +449,3 @@ else if (!$a7a032acae3ddda9$var$isElementInAnyScope(target)) $a7a032acae3ddda9$var$activeScope = null;

// eslint-disable-next-line no-restricted-globals
const nodeToRestoreRef = (0, $euGna$react.useRef)(typeof document !== 'undefined' ? (0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
const nodeToRestoreRef = (0, $euGna$react.useRef)(typeof document !== 'undefined' ? (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined)) : null);
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus

@@ -472,3 +460,3 @@ // restoring-non-containing scopes should only care if they become active so they can perform the restore

// Moving out of the active scope to an ancestor is not allowed.
if ((!$a7a032acae3ddda9$var$activeScope || $a7a032acae3ddda9$var$isAncestorScope($a7a032acae3ddda9$var$activeScope, scopeRef)) && $a7a032acae3ddda9$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $a7a032acae3ddda9$var$activeScope = scopeRef;
if ((!$a7a032acae3ddda9$var$activeScope || $a7a032acae3ddda9$var$isAncestorScope($a7a032acae3ddda9$var$activeScope, scopeRef)) && $a7a032acae3ddda9$var$isElementInScope((0, $euGna$reactariautils.getActiveElement)(ownerDocument), scopeRef.current)) $a7a032acae3ddda9$var$activeScope = scopeRef;
};

@@ -496,3 +484,3 @@ ownerDocument.addEventListener('focusin', onFocus, false);

let focusedElement = ownerDocument.activeElement;
if (!$a7a032acae3ddda9$var$isElementInScope(focusedElement, scopeRef.current)) return;
if (!$a7a032acae3ddda9$var$isElementInChildScope(focusedElement, scopeRef) || !$a7a032acae3ddda9$var$shouldRestoreFocus(scopeRef)) return;
let treeNode = $a7a032acae3ddda9$export$d06fae2ee68b101e.getTreeNode(scopeRef);

@@ -508,3 +496,3 @@ if (!treeNode) return;

let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
if (!nodeToRestore || !ownerDocument.body.contains(nodeToRestore) || nodeToRestore === ownerDocument.body) {
if (!nodeToRestore || !nodeToRestore.isConnected || nodeToRestore === ownerDocument.body) {
nodeToRestore = undefined;

@@ -515,7 +503,7 @@ treeNode.nodeToRestore = undefined;

// next element after the node to restore to instead.
if ((!nextElement || !$a7a032acae3ddda9$var$isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {
if ((!nextElement || !$a7a032acae3ddda9$var$isElementInChildScope(nextElement, scopeRef)) && nodeToRestore) {
walker.currentNode = nodeToRestore;
// Skip over elements within the scope, in case the scope immediately follows the node to restore.
do nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
while ($a7a032acae3ddda9$var$isElementInScope(nextElement, scopeRef.current));
while ($a7a032acae3ddda9$var$isElementInChildScope(nextElement, scopeRef));
e.preventDefault();

@@ -553,4 +541,4 @@ e.stopPropagation();

// if we already lost focus to the body and this was the active scope, then we should attempt to restore
if (restoreFocus && nodeToRestore && // eslint-disable-next-line react-hooks/exhaustive-deps
($a7a032acae3ddda9$var$isElementInScope(ownerDocument.activeElement, scopeRef.current) || ownerDocument.activeElement === ownerDocument.body && $a7a032acae3ddda9$var$shouldRestoreFocus(scopeRef))) {
let activeElement = (0, $euGna$reactariautils.getActiveElement)(ownerDocument);
if (restoreFocus && nodeToRestore && (activeElement && $a7a032acae3ddda9$var$isElementInChildScope(activeElement, scopeRef) || activeElement === ownerDocument.body && $a7a032acae3ddda9$var$shouldRestoreFocus(scopeRef))) {
// freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it

@@ -600,4 +588,9 @@ let clonedTree = $a7a032acae3ddda9$export$d06fae2ee68b101e.clone();

function $a7a032acae3ddda9$export$2d6ec8fc375ceafa(root, opts, scope) {
let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $a7a032acae3ddda9$var$TABBABLE_ELEMENT_SELECTOR : $a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR;
let walker = (0, $euGna$reactariautils.getOwnerDocument)(root).createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
let filter = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? (0, $euGna$reactariautils.isTabbable) : (0, $euGna$reactariautils.isFocusable);
// Ensure that root is an Element or fall back appropriately
let rootElement = (root === null || root === void 0 ? void 0 : root.nodeType) === Node.ELEMENT_NODE ? root : null;
// Determine the document to use
let doc = (0, $euGna$reactariautils.getOwnerDocument)(rootElement);
// Create a TreeWalker, ensuring the root is an Element or Document
let walker = (0, $euGna$reactariautils.createShadowTreeWalker)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {
acceptNode (node) {

@@ -607,3 +600,3 @@ var _opts_from;

if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;
if (node.matches(selector) && (0, $d5156037ad898a4d$exports.isElementVisible)(node) && (!scope || $a7a032acae3ddda9$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
if (filter(node) && (0, $d5156037ad898a4d$exports.isElementVisible)(node) && (!scope || $a7a032acae3ddda9$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
return NodeFilter.FILTER_SKIP;

@@ -621,3 +614,3 @@ }

let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
let node = from || (0, $euGna$reactariautils.getOwnerDocument)(root).activeElement;
let node = from || (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)(root));
let walker = $a7a032acae3ddda9$export$2d6ec8fc375ceafa(root, {

@@ -640,3 +633,3 @@ tabbable: tabbable,

let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
let node = from || (0, $euGna$reactariautils.getOwnerDocument)(root).activeElement;
let node = from || (0, $euGna$reactariautils.getActiveElement)((0, $euGna$reactariautils.getOwnerDocument)(root));
let walker = $a7a032acae3ddda9$export$2d6ec8fc375ceafa(root, {

@@ -643,0 +636,0 @@ tabbable: tabbable,

import {focusSafely as $6a99195332edec8b$export$80f3e147d781571c} from "./focusSafely.module.js";
import {isElementVisible as $645f2e67b85a24c9$export$e989c0fffaa6b27a} from "./isElementVisible.module.js";
import {useLayoutEffect as $cgawC$useLayoutEffect, getOwnerDocument as $cgawC$getOwnerDocument} from "@react-aria/utils";
import {useLayoutEffect as $cgawC$useLayoutEffect, getActiveElement as $cgawC$getActiveElement, getOwnerDocument as $cgawC$getOwnerDocument, getEventTarget as $cgawC$getEventTarget, isAndroid as $cgawC$isAndroid, isChrome as $cgawC$isChrome, isTabbable as $cgawC$isTabbable, isFocusable as $cgawC$isFocusable, createShadowTreeWalker as $cgawC$createShadowTreeWalker} from "@react-aria/utils";
import {getInteractionModality as $cgawC$getInteractionModality} from "@react-aria/interactions";
import $cgawC$react, {useRef as $cgawC$useRef, useContext as $cgawC$useContext, useMemo as $cgawC$useMemo, useEffect as $cgawC$useEffect} from "react";

@@ -20,2 +21,3 @@

const $9bf71ea28793e738$var$FocusContext = /*#__PURE__*/ (0, $cgawC$react).createContext(null);

@@ -85,3 +87,3 @@ const $9bf71ea28793e738$var$RESTORE_FOCUS_EVENT = 'react-aria-focus-scope-restore';

(0, $cgawC$useEffect)(()=>{
const activeElement = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement;
const activeElement = (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined));
let scope = null;

@@ -140,3 +142,4 @@ if ($9bf71ea28793e738$var$isElementInScope(activeElement, scopeRef.current)) {

let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
let node = from || (0, $cgawC$getOwnerDocument)(scope[0]).activeElement;
var _scope_;
let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
let sentinel = scope[0].previousElementSibling;

@@ -160,3 +163,4 @@ let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);

let { from: from, tabbable: tabbable, wrap: wrap, accept: accept } = opts;
let node = from || (0, $cgawC$getOwnerDocument)(scope[0]).activeElement;
var _scope_;
let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)((_scope_ = scope[0]) !== null && _scope_ !== void 0 ? _scope_ : undefined));
let sentinel = scope[scope.length - 1].nextElementSibling;

@@ -205,23 +209,2 @@ let scopeRoot = $9bf71ea28793e738$var$getScopeRoot(scope);

}
const $9bf71ea28793e738$var$focusableElements = [
'input:not([disabled]):not([type=hidden])',
'select:not([disabled])',
'textarea:not([disabled])',
'button:not([disabled])',
'a[href]',
'area[href]',
'summary',
'iframe',
'object',
'embed',
'audio[controls]',
'video[controls]',
'[contenteditable]'
];
const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
$9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
const $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $9bf71ea28793e738$export$4c063cf1350e6fed(element) {
return element.matches($9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR);
}
function $9bf71ea28793e738$var$getScopeRoot(scope) {

@@ -255,3 +238,3 @@ return scope[0].parentElement;

if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef) || e.isComposing) return;
let focusedElement = ownerDocument.activeElement;
let focusedElement = (0, $cgawC$getActiveElement)(ownerDocument);
let scope = scopeRef.current;

@@ -276,6 +259,6 @@ if (!scope || !$9bf71ea28793e738$var$isElementInScope(focusedElement, scope)) return;

// Moving out of the active scope to an ancestor is not allowed.
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(e.target, scopeRef.current)) {
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getEventTarget)(e), scopeRef.current)) {
$9bf71ea28793e738$var$activeScope = scopeRef;
focusedNode.current = e.target;
} else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(e.target, scopeRef)) {
focusedNode.current = (0, $cgawC$getEventTarget)(e);
} else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope((0, $cgawC$getEventTarget)(e), scopeRef)) {
// If a focus event occurs outside the active scope (e.g. user tabs from browser location bar),

@@ -285,3 +268,3 @@ // restore focus to the previously focused node or the first tabbable element in the active scope.

else if ($9bf71ea28793e738$var$activeScope && $9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);
} else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef)) focusedNode.current = e.target;
} else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef)) focusedNode.current = (0, $cgawC$getEventTarget)(e);
};

@@ -292,8 +275,15 @@ let onBlur = (e)=>{

raf.current = requestAnimationFrame(()=>{
// Patches infinite focus coersion loop for Android Talkback where the user isn't able to move the virtual cursor
// if within a containing focus scope. Bug filed against Chrome: https://issuetracker.google.com/issues/384844019.
// Note that this means focus can leave focus containing modals due to this, but it is isolated to Chrome Talkback.
let modality = (0, $cgawC$getInteractionModality)();
let shouldSkipFocusRestore = (modality === 'virtual' || modality === null) && (0, $cgawC$isAndroid)() && (0, $cgawC$isChrome)();
// Use document.activeElement instead of e.relatedTarget so we can tell if user clicked into iframe
if (ownerDocument.activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(ownerDocument.activeElement, scopeRef)) {
let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);
if (!shouldSkipFocusRestore && activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef)) {
$9bf71ea28793e738$var$activeScope = scopeRef;
if (ownerDocument.body.contains(e.target)) {
let target = (0, $cgawC$getEventTarget)(e);
if (target && target.isConnected) {
var _focusedNode_current;
focusedNode.current = e.target;
focusedNode.current = target;
(_focusedNode_current = focusedNode.current) === null || _focusedNode_current === void 0 ? void 0 : _focusedNode_current.focus();

@@ -319,3 +309,2 @@ } else if ($9bf71ea28793e738$var$activeScope.current) $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);

// This is a useLayoutEffect so it is guaranteed to run before our async synthetic blur
// eslint-disable-next-line arrow-body-style
(0, $cgawC$useLayoutEffect)(()=>{

@@ -362,3 +351,3 @@ return ()=>{

(0, $6a99195332edec8b$export$80f3e147d781571c)(element);
} catch (err) {
} catch {
// ignore

@@ -368,3 +357,3 @@ }

element.focus();
} catch (err) {
} catch {
// ignore

@@ -401,3 +390,3 @@ }

const ownerDocument = (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined);
if (!$9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, $9bf71ea28793e738$var$activeScope.current) && scopeRef.current) $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);
if (!$9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), $9bf71ea28793e738$var$activeScope.current) && scopeRef.current) $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);
}

@@ -417,3 +406,3 @@ autoFocusRef.current = false;

let onFocus = (e)=>{
let target = e.target;
let target = (0, $cgawC$getEventTarget)(e);
if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;

@@ -445,3 +434,3 @@ else if (!$9bf71ea28793e738$var$isElementInAnyScope(target)) $9bf71ea28793e738$var$activeScope = null;

// eslint-disable-next-line no-restricted-globals
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined).activeElement : null);
const nodeToRestoreRef = (0, $cgawC$useRef)(typeof document !== 'undefined' ? (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(scopeRef.current ? scopeRef.current[0] : undefined)) : null);
// restoring scopes should all track if they are active regardless of contain, but contain already tracks it plus logic to contain the focus

@@ -456,3 +445,3 @@ // restoring-non-containing scopes should only care if they become active so they can perform the restore

// Moving out of the active scope to an ancestor is not allowed.
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope((0, $cgawC$getActiveElement)(ownerDocument), scopeRef.current)) $9bf71ea28793e738$var$activeScope = scopeRef;
};

@@ -480,3 +469,3 @@ ownerDocument.addEventListener('focusin', onFocus, false);

let focusedElement = ownerDocument.activeElement;
if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scopeRef.current)) return;
if (!$9bf71ea28793e738$var$isElementInChildScope(focusedElement, scopeRef) || !$9bf71ea28793e738$var$shouldRestoreFocus(scopeRef)) return;
let treeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);

@@ -492,3 +481,3 @@ if (!treeNode) return;

let nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
if (!nodeToRestore || !ownerDocument.body.contains(nodeToRestore) || nodeToRestore === ownerDocument.body) {
if (!nodeToRestore || !nodeToRestore.isConnected || nodeToRestore === ownerDocument.body) {
nodeToRestore = undefined;

@@ -499,7 +488,7 @@ treeNode.nodeToRestore = undefined;

// next element after the node to restore to instead.
if ((!nextElement || !$9bf71ea28793e738$var$isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {
if ((!nextElement || !$9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef)) && nodeToRestore) {
walker.currentNode = nodeToRestore;
// Skip over elements within the scope, in case the scope immediately follows the node to restore.
do nextElement = e.shiftKey ? walker.previousNode() : walker.nextNode();
while ($9bf71ea28793e738$var$isElementInScope(nextElement, scopeRef.current));
while ($9bf71ea28793e738$var$isElementInChildScope(nextElement, scopeRef));
e.preventDefault();

@@ -537,4 +526,4 @@ e.stopPropagation();

// if we already lost focus to the body and this was the active scope, then we should attempt to restore
if (restoreFocus && nodeToRestore && // eslint-disable-next-line react-hooks/exhaustive-deps
($9bf71ea28793e738$var$isElementInScope(ownerDocument.activeElement, scopeRef.current) || ownerDocument.activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
let activeElement = (0, $cgawC$getActiveElement)(ownerDocument);
if (restoreFocus && nodeToRestore && (activeElement && $9bf71ea28793e738$var$isElementInChildScope(activeElement, scopeRef) || activeElement === ownerDocument.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
// freeze the focusScopeTree so it persists after the raf, otherwise during unmount nodes are removed from it

@@ -584,4 +573,9 @@ let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();

function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
let walker = (0, $cgawC$getOwnerDocument)(root).createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
let filter = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? (0, $cgawC$isTabbable) : (0, $cgawC$isFocusable);
// Ensure that root is an Element or fall back appropriately
let rootElement = (root === null || root === void 0 ? void 0 : root.nodeType) === Node.ELEMENT_NODE ? root : null;
// Determine the document to use
let doc = (0, $cgawC$getOwnerDocument)(rootElement);
// Create a TreeWalker, ensuring the root is an Element or Document
let walker = (0, $cgawC$createShadowTreeWalker)(doc, root || doc, NodeFilter.SHOW_ELEMENT, {
acceptNode (node) {

@@ -591,3 +585,3 @@ var _opts_from;

if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node)) return NodeFilter.FILTER_REJECT;
if (node.matches(selector) && (0, $645f2e67b85a24c9$export$e989c0fffaa6b27a)(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
if (filter(node) && (0, $645f2e67b85a24c9$export$e989c0fffaa6b27a)(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
return NodeFilter.FILTER_SKIP;

@@ -605,3 +599,3 @@ }

let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
let node = from || (0, $cgawC$getOwnerDocument)(root).activeElement;
let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {

@@ -624,3 +618,3 @@ tabbable: tabbable,

let { from: from, tabbable: tabbable = defaultOptions.tabbable, wrap: wrap = defaultOptions.wrap, accept: accept = defaultOptions.accept } = opts;
let node = from || (0, $cgawC$getOwnerDocument)(root).activeElement;
let node = from || (0, $cgawC$getActiveElement)((0, $cgawC$getOwnerDocument)(root));
let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, {

@@ -757,3 +751,3 @@ tabbable: tabbable,

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};
export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$d06fae2ee68b101e as focusScopeTree, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager};
//# sourceMappingURL=FocusScope.module.js.map

@@ -7,2 +7,3 @@ var $a7a032acae3ddda9$exports = require("./FocusScope.main.js");

var $259c6413a286f2e6$exports = require("./useHasTabbableChild.main.js");
var $aB6Cp$reactariautils = require("@react-aria/utils");

@@ -19,3 +20,2 @@

$parcel$export(module.exports, "isElementInChildOfActiveScope", () => $a7a032acae3ddda9$exports.isElementInChildOfActiveScope);
$parcel$export(module.exports, "isFocusable", () => $a7a032acae3ddda9$exports.isFocusable);
$parcel$export(module.exports, "FocusRing", () => $dfd8c70b928eb1b3$exports.FocusRing);

@@ -27,2 +27,3 @@ $parcel$export(module.exports, "FocusableProvider", () => $fb504d83237fd6ac$exports.FocusableProvider);

$parcel$export(module.exports, "useHasTabbableChild", () => $259c6413a286f2e6$exports.useHasTabbableChild);
$parcel$export(module.exports, "isFocusable", () => $aB6Cp$reactariautils.isFocusable);
/*

@@ -46,2 +47,3 @@ * Copyright 2020 Adobe. All rights reserved.

//# sourceMappingURL=main.js.map

@@ -1,2 +0,2 @@

import {createFocusManager as $9bf71ea28793e738$export$c5251b9e124bf29, FocusScope as $9bf71ea28793e738$export$20e40289641fbbb6, getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa, isElementInChildOfActiveScope as $9bf71ea28793e738$export$1258395f99bf9cbf, isFocusable as $9bf71ea28793e738$export$4c063cf1350e6fed, useFocusManager as $9bf71ea28793e738$export$10c5169755ce7bd7} from "./FocusScope.module.js";
import {createFocusManager as $9bf71ea28793e738$export$c5251b9e124bf29, FocusScope as $9bf71ea28793e738$export$20e40289641fbbb6, getFocusableTreeWalker as $9bf71ea28793e738$export$2d6ec8fc375ceafa, isElementInChildOfActiveScope as $9bf71ea28793e738$export$1258395f99bf9cbf, useFocusManager as $9bf71ea28793e738$export$10c5169755ce7bd7} from "./FocusScope.module.js";
import {FocusRing as $907718708eab68af$export$1a38b4ad7f578e1d} from "./FocusRing.module.js";

@@ -7,2 +7,3 @@ import {FocusableProvider as $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5, useFocusable as $e6afbd83fe6ebbd2$export$4c014de7c8940b4c} from "./useFocusable.module.js";

import {useHasTabbableChild as $83013635b024ae3d$export$eac1895992b9f3d6} from "./useHasTabbableChild.module.js";
import {isFocusable as $d48f97c9d1a8e323$re_export$isFocusable} from "@react-aria/utils";

@@ -27,3 +28,4 @@ /*

export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $9bf71ea28793e738$export$4c063cf1350e6fed as isFocusable, $907718708eab68af$export$1a38b4ad7f578e1d as FocusRing, $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 as FocusableProvider, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c as useFocusable, $f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing, $6a99195332edec8b$export$80f3e147d781571c as focusSafely, $83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild};
export {$9bf71ea28793e738$export$20e40289641fbbb6 as FocusScope, $9bf71ea28793e738$export$10c5169755ce7bd7 as useFocusManager, $9bf71ea28793e738$export$2d6ec8fc375ceafa as getFocusableTreeWalker, $9bf71ea28793e738$export$c5251b9e124bf29 as createFocusManager, $9bf71ea28793e738$export$1258395f99bf9cbf as isElementInChildOfActiveScope, $907718708eab68af$export$1a38b4ad7f578e1d as FocusRing, $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 as FocusableProvider, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c as useFocusable, $f7dceffc5ad7768b$export$4e328f61c538687f as useFocusRing, $6a99195332edec8b$export$80f3e147d781571c as focusSafely, $83013635b024ae3d$export$eac1895992b9f3d6 as useHasTabbableChild, $d48f97c9d1a8e323$re_export$isFocusable as isFocusable};
//# sourceMappingURL=module.js.map
import { FocusableElement, RefObject, DOMAttributes, FocusableDOMProps, FocusableProps } from "@react-types/shared";
import { ShadowTreeWalker } from "@react-aria/utils";
import React, { ReactNode, ReactElement } from "react";

@@ -58,3 +59,2 @@ /**

export function useFocusManager(): FocusManager | undefined;
export function isFocusable(element: HTMLElement): boolean;
/** @private */

@@ -66,3 +66,3 @@ export function isElementInChildOfActiveScope(element: Element): boolean;

*/
export function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]): TreeWalker;
export function getFocusableTreeWalker(root: Element, opts?: FocusManagerOptions, scope?: Element[]): ShadowTreeWalker | TreeWalker;
/**

@@ -124,3 +124,3 @@ * Creates a FocusManager object that can be used to move focus within an element.

export function FocusRing(props: FocusRingProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
export interface FocusableOptions extends FocusableProps, FocusableDOMProps {
export interface FocusableOptions<T = FocusableElement> extends FocusableProps<T>, FocusableDOMProps {
/** Whether focus should be disabled. */

@@ -133,3 +133,6 @@ isDisabled?: boolean;

}
export let FocusableProvider: React.ForwardRefExoticComponent<FocusableProviderProps & React.RefAttributes<FocusableElement>>;
/**
* Provides DOM props to the nearest focusable child.
*/
export const FocusableProvider: React.ForwardRefExoticComponent<FocusableProviderProps & React.RefAttributes<FocusableElement>>;
export interface FocusableAria {

@@ -142,3 +145,3 @@ /** Props for the focusable element. */

*/
export function useFocusable(props: FocusableOptions, domRef: RefObject<FocusableElement | null>): FocusableAria;
export function useFocusable<T extends FocusableElement = FocusableElement>(props: FocusableOptions<T>, domRef: RefObject<FocusableElement | null>): FocusableAria;
interface AriaHasTabbableChildOptions {

@@ -152,3 +155,4 @@ isDisabled?: boolean;

export function useHasTabbableChild(ref: RefObject<Element | null>, options?: AriaHasTabbableChildOptions): boolean;
export { isFocusable } from '@react-aria/utils';
//# sourceMappingURL=types.d.ts.map

@@ -39,5 +39,3 @@ var $1c7f9157d722357d$exports = require("./focusSafely.main.js");

}
/**
* Provides DOM props to the nearest focusable child.
*/ function $fb504d83237fd6ac$var$FocusableProvider(props, ref) {
const $fb504d83237fd6ac$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, ($parcel$interopDefault($ggOO2$react))).forwardRef(function FocusableProvider(props, ref) {
let { children: children, ...otherProps } = props;

@@ -52,4 +50,3 @@ let objRef = (0, $ggOO2$reactariautils.useObjectRef)(ref);

}, children);
}
let $fb504d83237fd6ac$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, ($parcel$interopDefault($ggOO2$react))).forwardRef($fb504d83237fd6ac$var$FocusableProvider);
});
function $fb504d83237fd6ac$export$4c014de7c8940b4c(props, domRef) {

@@ -68,6 +65,9 @@ let { focusProps: focusProps } = (0, $ggOO2$reactariainteractions.useFocus)(props);

]);
// Always set a tabIndex so that Safari allows focusing native buttons and inputs.
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
if (props.isDisabled) tabIndex = undefined;
return {
focusableProps: (0, $ggOO2$reactariautils.mergeProps)({
...interactions,
tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined
tabIndex: tabIndex
}, interactionProps)

@@ -74,0 +74,0 @@ };

@@ -28,5 +28,3 @@ import {focusSafely as $6a99195332edec8b$export$80f3e147d781571c} from "./focusSafely.module.js";

}
/**
* Provides DOM props to the nearest focusable child.
*/ function $e6afbd83fe6ebbd2$var$FocusableProvider(props, ref) {
const $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, $h8xso$react).forwardRef(function FocusableProvider(props, ref) {
let { children: children, ...otherProps } = props;

@@ -41,4 +39,3 @@ let objRef = (0, $h8xso$useObjectRef)(ref);

}, children);
}
let $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 = /*#__PURE__*/ (0, $h8xso$react).forwardRef($e6afbd83fe6ebbd2$var$FocusableProvider);
});
function $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, domRef) {

@@ -57,6 +54,9 @@ let { focusProps: focusProps } = (0, $h8xso$useFocus)(props);

]);
// Always set a tabIndex so that Safari allows focusing native buttons and inputs.
let tabIndex = props.excludeFromTabOrder ? -1 : 0;
if (props.isDisabled) tabIndex = undefined;
return {
focusableProps: (0, $h8xso$mergeProps)({
...interactions,
tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : undefined
tabIndex: tabIndex
}, interactionProps)

@@ -63,0 +63,0 @@ };

{
"name": "@react-aria/focus",
"version": "3.0.0-nightly-4980928d3-240906",
"version": "3.0.0-nightly-4b8b33a02-250211",
"description": "Spectrum UI components in React",

@@ -25,5 +25,5 @@ "license": "Apache-2.0",

"dependencies": {
"@react-aria/interactions": "^3.0.0-nightly-4980928d3-240906",
"@react-aria/utils": "^3.0.0-nightly-4980928d3-240906",
"@react-types/shared": "^3.0.0-nightly-4980928d3-240906",
"@react-aria/interactions": "3.0.0-nightly-4b8b33a02-250211",
"@react-aria/utils": "3.0.0-nightly-4b8b33a02-250211",
"@react-types/shared": "3.0.0-nightly-4b8b33a02-250211",
"@swc/helpers": "^0.5.0",

@@ -33,8 +33,8 @@ "clsx": "^2.0.0"

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"stableVersion": "3.18.2"
}
}

@@ -14,3 +14,8 @@ /*

import {FocusableElement} from '@react-types/shared';
import {focusWithoutScrolling, getOwnerDocument, runAfterTransition} from '@react-aria/utils';
import {
focusWithoutScrolling,
getActiveElement,
getOwnerDocument,
runAfterTransition
} from '@react-aria/utils';
import {getInteractionModality} from '@react-aria/interactions';

@@ -29,7 +34,8 @@

const ownerDocument = getOwnerDocument(element);
const activeElement = getActiveElement(ownerDocument);
if (getInteractionModality() === 'virtual') {
let lastFocusedElement = ownerDocument.activeElement;
let lastFocusedElement = activeElement;
runAfterTransition(() => {
// If focus did not move and the element is still in the document, focus it.
if (ownerDocument.activeElement === lastFocusedElement && element.isConnected) {
if (getActiveElement(ownerDocument) === lastFocusedElement && element.isConnected) {
focusWithoutScrolling(element);

@@ -36,0 +42,0 @@ }

@@ -13,3 +13,3 @@ /*

export {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope, isFocusable} from './FocusScope';
export {FocusScope, useFocusManager, getFocusableTreeWalker, createFocusManager, isElementInChildOfActiveScope} from './FocusScope';
export {FocusRing} from './FocusRing';

@@ -20,2 +20,4 @@ export {FocusableProvider, useFocusable} from './useFocusable';

export {useHasTabbableChild} from './useHasTabbableChild';
// For backward compatibility.
export {isFocusable} from '@react-aria/utils';

@@ -22,0 +24,0 @@ export type {FocusScopeProps, FocusManager, FocusManagerOptions} from './FocusScope';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc