@react-stately/menu
Advanced tools
Comparing version 3.0.0-nightly-a98da553e-241116 to 3.0.0-nightly-ab9fd5c68-241122
@@ -30,4 +30,4 @@ var $9cbje$react = require("react"); | ||
let [focusStrategy, setFocusStrategy] = (0, $9cbje$react.useState)(null); | ||
let open = (0, $9cbje$react.useCallback)((focusStrategy = null)=>{ | ||
setFocusStrategy(focusStrategy); | ||
let open = (0, $9cbje$react.useCallback)((focusStrategy)=>{ | ||
setFocusStrategy(focusStrategy !== null && focusStrategy !== void 0 ? focusStrategy : null); | ||
openSubmenu(triggerKey, submenuLevel); | ||
@@ -47,4 +47,4 @@ }, [ | ||
]); | ||
let toggle = (0, $9cbje$react.useCallback)((focusStrategy = null)=>{ | ||
setFocusStrategy(focusStrategy); | ||
let toggle = (0, $9cbje$react.useCallback)((focusStrategy)=>{ | ||
setFocusStrategy(focusStrategy !== null && focusStrategy !== void 0 ? focusStrategy : null); | ||
if (isOpen) close(); | ||
@@ -51,0 +51,0 @@ else open(focusStrategy); |
@@ -24,4 +24,4 @@ import {useState as $7exkJ$useState, useMemo as $7exkJ$useMemo, useCallback as $7exkJ$useCallback} from "react"; | ||
let [focusStrategy, setFocusStrategy] = (0, $7exkJ$useState)(null); | ||
let open = (0, $7exkJ$useCallback)((focusStrategy = null)=>{ | ||
setFocusStrategy(focusStrategy); | ||
let open = (0, $7exkJ$useCallback)((focusStrategy)=>{ | ||
setFocusStrategy(focusStrategy !== null && focusStrategy !== void 0 ? focusStrategy : null); | ||
openSubmenu(triggerKey, submenuLevel); | ||
@@ -41,4 +41,4 @@ }, [ | ||
]); | ||
let toggle = (0, $7exkJ$useCallback)((focusStrategy = null)=>{ | ||
setFocusStrategy(focusStrategy); | ||
let toggle = (0, $7exkJ$useCallback)((focusStrategy)=>{ | ||
setFocusStrategy(focusStrategy !== null && focusStrategy !== void 0 ? focusStrategy : null); | ||
if (isOpen) close(); | ||
@@ -45,0 +45,0 @@ else open(focusStrategy); |
{ | ||
"name": "@react-stately/menu", | ||
"version": "3.0.0-nightly-a98da553e-241116", | ||
"version": "3.0.0-nightly-ab9fd5c68-241122", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,9 +25,9 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/overlays": "^3.0.0-nightly-a98da553e-241116", | ||
"@react-types/menu": "^3.0.0-nightly-a98da553e-241116", | ||
"@react-types/shared": "^3.0.0-nightly-a98da553e-241116", | ||
"@react-stately/overlays": "^3.0.0-nightly-ab9fd5c68-241122", | ||
"@react-types/menu": "^3.0.0-nightly-ab9fd5c68-241122", | ||
"@react-types/shared": "^3.0.0-nightly-ab9fd5c68-241122", | ||
"@swc/helpers": "^0.5.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" | ||
}, | ||
@@ -37,3 +37,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.8.3" | ||
"stableVersion": "3.9.0" | ||
} |
@@ -51,6 +51,6 @@ /* | ||
let isOpen = useMemo(() => expandedKeysStack[submenuLevel] === triggerKey, [expandedKeysStack, triggerKey, submenuLevel]); | ||
let [focusStrategy, setFocusStrategy] = useState<FocusStrategy>(null); | ||
let [focusStrategy, setFocusStrategy] = useState<FocusStrategy | null>(null); | ||
let open = useCallback((focusStrategy: FocusStrategy = null) => { | ||
setFocusStrategy(focusStrategy); | ||
let open = useCallback((focusStrategy?: FocusStrategy | null) => { | ||
setFocusStrategy(focusStrategy ?? null); | ||
openSubmenu(triggerKey, submenuLevel); | ||
@@ -64,4 +64,4 @@ }, [openSubmenu, submenuLevel, triggerKey]); | ||
let toggle = useCallback((focusStrategy: FocusStrategy = null) => { | ||
setFocusStrategy(focusStrategy); | ||
let toggle = useCallback((focusStrategy?: FocusStrategy | null) => { | ||
setFocusStrategy(focusStrategy ?? null); | ||
if (isOpen) { | ||
@@ -68,0 +68,0 @@ close(); |
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
53451