@react-aria/selection
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -6,2 +6,3 @@ var { | ||
var { | ||
isMac, | ||
mergeProps | ||
@@ -103,6 +104,4 @@ } = require("@react-aria/utils"); | ||
const $f791fefd7189e0e4d903034fb2925$var$isMac = typeof window !== 'undefined' && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false; | ||
function $f791fefd7189e0e4d903034fb2925$var$isCtrlKeyPressed(e) { | ||
if ($f791fefd7189e0e4d903034fb2925$var$isMac) { | ||
if (isMac()) { | ||
return e.metaKey; | ||
@@ -737,3 +736,3 @@ } | ||
useEffect(() => { | ||
if (!isVirtualized && selectionManager.focusedKey) { | ||
if (!isVirtualized && selectionManager.focusedKey && (ref == null ? void 0 : ref.current)) { | ||
let element = ref.current.querySelector("[data-key=\"" + selectionManager.focusedKey + "\"]"); | ||
@@ -740,0 +739,0 @@ |
import { useCollator } from "@react-aria/i18n"; | ||
import { mergeProps } from "@react-aria/utils"; | ||
import { isMac, mergeProps } from "@react-aria/utils"; | ||
import { focusSafely, getFocusableTreeWalker } from "@react-aria/focus"; | ||
@@ -81,6 +81,4 @@ import { useEffect, useRef, useMemo } from "react"; | ||
const $a9b9aa71af07c56ab1d89ca45381f4b$var$isMac = typeof window !== 'undefined' && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false; | ||
function $a9b9aa71af07c56ab1d89ca45381f4b$var$isCtrlKeyPressed(e) { | ||
if ($a9b9aa71af07c56ab1d89ca45381f4b$var$isMac) { | ||
if (isMac()) { | ||
return e.metaKey; | ||
@@ -709,3 +707,3 @@ } | ||
useEffect(() => { | ||
if (!isVirtualized && selectionManager.focusedKey) { | ||
if (!isVirtualized && selectionManager.focusedKey && (ref == null ? void 0 : ref.current)) { | ||
let element = ref.current.querySelector("[data-key=\"" + selectionManager.focusedKey + "\"]"); | ||
@@ -712,0 +710,0 @@ |
{ | ||
"name": "@react-aria/selection", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "Spectrum UI components in React", | ||
@@ -22,8 +22,8 @@ "license": "Apache-2.0", | ||
"@react-aria/focus": "^3.2.3", | ||
"@react-aria/i18n": "^3.2.0", | ||
"@react-aria/interactions": "^3.3.2", | ||
"@react-aria/utils": "^3.4.1", | ||
"@react-aria/i18n": "^3.3.0", | ||
"@react-aria/interactions": "^3.3.3", | ||
"@react-aria/utils": "^3.6.0", | ||
"@react-stately/collections": "^3.3.0", | ||
"@react-stately/selection": "^3.3.0", | ||
"@react-types/shared": "^3.3.0" | ||
"@react-types/shared": "^3.4.0" | ||
}, | ||
@@ -36,3 +36,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "f5b429ee8615248f2e3c76754bad2ece83f1c444" | ||
"gitHead": "7f9dc7fa5144679d2dc733170cb5c1f40d0c5ee5" | ||
} |
@@ -16,13 +16,8 @@ /* | ||
import {FocusStrategy, KeyboardDelegate} from '@react-types/shared'; | ||
import {mergeProps} from '@react-aria/utils'; | ||
import {isMac, mergeProps} from '@react-aria/utils'; | ||
import {MultipleSelectionManager} from '@react-stately/selection'; | ||
import {useTypeSelect} from './useTypeSelect'; | ||
const isMac = | ||
typeof window !== 'undefined' && window.navigator != null | ||
? /^Mac/.test(window.navigator.platform) | ||
: false; | ||
function isCtrlKeyPressed(e: KeyboardEvent) { | ||
if (isMac) { | ||
if (isMac()) { | ||
return e.metaKey; | ||
@@ -29,0 +24,0 @@ } |
@@ -110,3 +110,3 @@ /* | ||
useEffect(() => { | ||
if (!isVirtualized && selectionManager.focusedKey) { | ||
if (!isVirtualized && selectionManager.focusedKey && ref?.current) { | ||
let element = ref.current.querySelector(`[data-key="${selectionManager.focusedKey}"]`) as HTMLElement; | ||
@@ -113,0 +113,0 @@ if (element) { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198429
2304
Updated@react-aria/i18n@^3.3.0
Updated@react-aria/utils@^3.6.0
Updated@react-types/shared@^3.4.0