Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-aria/focus

Package Overview
Dependencies
Maintainers
2
Versions
878
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.19.0 to 3.19.1

11

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

@@ -35,2 +36,3 @@ var $euGna$react = require("react");

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

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

'video[controls]',
'[contenteditable]'
'[contenteditable]:not([contenteditable^="false"])'
];

@@ -301,4 +303,9 @@ const $a7a032acae3ddda9$var$FOCUSABLE_ELEMENT_SELECTOR = $a7a032acae3ddda9$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';

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)) {
if (!shouldSkipFocusRestore && ownerDocument.activeElement && $a7a032acae3ddda9$var$shouldContainFocus(scopeRef) && !$a7a032acae3ddda9$var$isElementInChildScope(ownerDocument.activeElement, scopeRef)) {
$a7a032acae3ddda9$var$activeScope = scopeRef;

@@ -305,0 +312,0 @@ if (ownerDocument.body.contains(e.target)) {

13

dist/FocusScope.module.js
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 {getInteractionModality as $cgawC$getInteractionModality} from "@react-aria/interactions";
import {useLayoutEffect as $cgawC$useLayoutEffect, getOwnerDocument as $cgawC$getOwnerDocument, isAndroid as $cgawC$isAndroid, isChrome as $cgawC$isChrome} from "@react-aria/utils";
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);

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

'video[controls]',
'[contenteditable]'
'[contenteditable]:not([contenteditable^="false"])'
];

@@ -286,4 +288,9 @@ const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';

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)) {
if (!shouldSkipFocusRestore && ownerDocument.activeElement && $9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(ownerDocument.activeElement, scopeRef)) {
$9bf71ea28793e738$var$activeScope = scopeRef;

@@ -290,0 +297,0 @@ if (ownerDocument.body.contains(e.target)) {

@@ -130,3 +130,6 @@ import { FocusableElement, RefObject, DOMAttributes, FocusableDOMProps, FocusableProps } from "@react-types/shared";

}
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 {

@@ -133,0 +136,0 @@ /** Props for the focusable element. */

@@ -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) {

@@ -56,0 +53,0 @@ let { focusProps: focusProps } = (0, $ggOO2$reactariainteractions.useFocus)(props);

@@ -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) {

@@ -45,0 +42,0 @@ let { focusProps: focusProps } = (0, $h8xso$useFocus)(props);

{
"name": "@react-aria/focus",
"version": "3.19.0",
"version": "3.19.1",
"description": "Spectrum UI components in React",

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

"dependencies": {
"@react-aria/interactions": "^3.22.5",
"@react-aria/utils": "^3.26.0",
"@react-types/shared": "^3.26.0",
"@react-aria/interactions": "^3.23.0",
"@react-aria/utils": "^3.27.0",
"@react-types/shared": "^3.27.0",
"@swc/helpers": "^0.5.0",

@@ -33,3 +33,4 @@ "clsx": "^2.0.0"

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
"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"
},

@@ -39,3 +40,3 @@ "publishConfig": {

},
"gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
"gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
}

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