@react-aria/menu
Advanced tools
Comparing version 3.0.0-nightly-9b3385ac6-250228 to 3.0.0-nightly-9bd8a5f19-250304
var $62347d8c4183e713$exports = require("./useSafelyMouseToSubmenu.main.js"); | ||
var $23MMN$reactariautils = require("@react-aria/utils"); | ||
var $23MMN$reactariainteractions = require("@react-aria/interactions"); | ||
var $23MMN$react = require("react"); | ||
@@ -27,3 +26,2 @@ var $23MMN$reactariai18n = require("@react-aria/i18n"); | ||
function $5f4753043c9f6cdf$export$7138b0d059a6e743(props, state, ref) { | ||
@@ -59,2 +57,5 @@ let { parentMenuRef: parentMenuRef, submenuRef: submenuRef, type: type = 'menu', isDisabled: isDisabled, delay: delay = 200, shouldUseVirtualFocus: shouldUseVirtualFocus } = props; | ||
let submenuKeyDown = (e)=>{ | ||
// If focus is not within the menu, assume virtual focus is being used. | ||
// This means some other input element is also within the popover, so we shouldn't close the menu. | ||
if (!e.currentTarget.contains(document.activeElement)) return; | ||
switch(e.key){ | ||
@@ -174,6 +175,2 @@ case 'ArrowLeft': | ||
isNonModal: true, | ||
// We will manually coerce focus back to the triggers for mobile screen readers and non virtual focus use cases (aka submenus outside of autocomplete) so turn off | ||
// FocusScope then. For virtual focus use cases (Autocomplete subdialogs/menu) and subdialogs we want to keep FocusScope restoreFocus to automatically | ||
// send focus to parent subdialog input fields and/or tab containment | ||
disableFocusManagement: !shouldUseVirtualFocus && ((0, $23MMN$reactariainteractions.getInteractionModality)() === 'virtual' || type === 'menu'), | ||
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside | ||
@@ -180,0 +177,0 @@ } |
import {useSafelyMouseToSubmenu as $d275435c250248f8$export$85ec83e04c95f50a} from "./useSafelyMouseToSubmenu.module.js"; | ||
import {useId as $dXlYe$useId, useEffectEvent as $dXlYe$useEffectEvent, useLayoutEffect as $dXlYe$useLayoutEffect, focusWithoutScrolling as $dXlYe$focusWithoutScrolling} from "@react-aria/utils"; | ||
import {getInteractionModality as $dXlYe$getInteractionModality} from "@react-aria/interactions"; | ||
import {useRef as $dXlYe$useRef, useCallback as $dXlYe$useCallback} from "react"; | ||
@@ -21,3 +20,2 @@ import {useLocale as $dXlYe$useLocale} from "@react-aria/i18n"; | ||
function $0065b146e7192841$export$7138b0d059a6e743(props, state, ref) { | ||
@@ -53,2 +51,5 @@ let { parentMenuRef: parentMenuRef, submenuRef: submenuRef, type: type = 'menu', isDisabled: isDisabled, delay: delay = 200, shouldUseVirtualFocus: shouldUseVirtualFocus } = props; | ||
let submenuKeyDown = (e)=>{ | ||
// If focus is not within the menu, assume virtual focus is being used. | ||
// This means some other input element is also within the popover, so we shouldn't close the menu. | ||
if (!e.currentTarget.contains(document.activeElement)) return; | ||
switch(e.key){ | ||
@@ -168,6 +169,2 @@ case 'ArrowLeft': | ||
isNonModal: true, | ||
// We will manually coerce focus back to the triggers for mobile screen readers and non virtual focus use cases (aka submenus outside of autocomplete) so turn off | ||
// FocusScope then. For virtual focus use cases (Autocomplete subdialogs/menu) and subdialogs we want to keep FocusScope restoreFocus to automatically | ||
// send focus to parent subdialog input fields and/or tab containment | ||
disableFocusManagement: !shouldUseVirtualFocus && ((0, $dXlYe$getInteractionModality)() === 'virtual' || type === 'menu'), | ||
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside | ||
@@ -174,0 +171,0 @@ } |
{ | ||
"name": "@react-aria/menu", | ||
"version": "3.0.0-nightly-9b3385ac6-250228", | ||
"version": "3.0.0-nightly-9bd8a5f19-250304", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,15 +25,15 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/i18n": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/interactions": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/overlays": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/selection": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/utils": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-stately/collections": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-stately/menu": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-stately/selection": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-stately/tree": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-types/button": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-types/menu": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-types/shared": "3.0.0-nightly-9b3385ac6-250228", | ||
"@react-aria/focus": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-aria/i18n": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-aria/interactions": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-aria/overlays": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-aria/selection": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-aria/utils": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-stately/collections": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-stately/menu": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-stately/selection": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-stately/tree": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-types/button": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-types/menu": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@react-types/shared": "3.0.0-nightly-9bd8a5f19-250304", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -40,0 +40,0 @@ }, |
@@ -18,3 +18,2 @@ /* | ||
import {focusWithoutScrolling, useEffectEvent, useId, useLayoutEffect} from '@react-aria/utils'; | ||
import {getInteractionModality} from '@react-aria/interactions'; | ||
import type {SubmenuTriggerState} from '@react-stately/menu'; | ||
@@ -103,2 +102,8 @@ import {useCallback, useRef} from 'react'; | ||
let submenuKeyDown = (e: KeyboardEvent) => { | ||
// If focus is not within the menu, assume virtual focus is being used. | ||
// This means some other input element is also within the popover, so we shouldn't close the menu. | ||
if (!e.currentTarget.contains(document.activeElement)) { | ||
return; | ||
} | ||
switch (e.key) { | ||
@@ -255,6 +260,2 @@ case 'ArrowLeft': | ||
isNonModal: true, | ||
// We will manually coerce focus back to the triggers for mobile screen readers and non virtual focus use cases (aka submenus outside of autocomplete) so turn off | ||
// FocusScope then. For virtual focus use cases (Autocomplete subdialogs/menu) and subdialogs we want to keep FocusScope restoreFocus to automatically | ||
// send focus to parent subdialog input fields and/or tab containment | ||
disableFocusManagement: !shouldUseVirtualFocus && (getInteractionModality() === 'virtual' || type === 'menu'), | ||
shouldCloseOnInteractOutside | ||
@@ -261,0 +262,0 @@ } |
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
338636
4100
+ Added@internationalized/date@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@internationalized/message@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@internationalized/number@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@internationalized/string@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/focus@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/i18n@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/interactions@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/overlays@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/selection@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/ssr@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/utils@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-aria/visually-hidden@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/collections@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/flags@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/menu@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/overlays@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/selection@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/tree@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-stately/utils@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-types/button@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-types/menu@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-types/overlays@3.0.0-nightly-9bd8a5f19-250304(transitive)
+ Added@react-types/shared@3.0.0-nightly-9bd8a5f19-250304(transitive)
- Removed@internationalized/date@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@internationalized/message@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@internationalized/number@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@internationalized/string@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/focus@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/i18n@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/interactions@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/overlays@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/selection@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/ssr@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/utils@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-aria/visually-hidden@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/collections@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/flags@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/menu@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/overlays@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/selection@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/tree@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-stately/utils@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-types/button@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-types/menu@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-types/overlays@3.0.0-nightly-9b3385ac6-250228(transitive)
- Removed@react-types/shared@3.0.0-nightly-9b3385ac6-250228(transitive)
Updated@react-aria/interactions@3.0.0-nightly-9bd8a5f19-250304
Updated@react-stately/collections@3.0.0-nightly-9bd8a5f19-250304
Updated@react-stately/selection@3.0.0-nightly-9bd8a5f19-250304