From 10232fcf0aacbd94f8b4da209fea4dee6a441346 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Fri, 7 Mar 2025 11:27:18 -0800 Subject: [PATCH] fix: Prevent submenus from closing on scroll --- packages/@react-aria/overlays/src/usePopover.ts | 2 +- packages/react-aria-components/docs/SearchField.mdx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@react-aria/overlays/src/usePopover.ts b/packages/@react-aria/overlays/src/usePopover.ts index 00d1721cb1c..068c67e7bf4 100644 --- a/packages/@react-aria/overlays/src/usePopover.ts +++ b/packages/@react-aria/overlays/src/usePopover.ts @@ -106,7 +106,7 @@ export function usePopover(props: AriaPopoverProps, state: OverlayTriggerState): targetRef: triggerRef, overlayRef: popoverRef, isOpen: state.isOpen, - onClose: isNonModal ? state.close : null + onClose: isNonModal && !isSubmenu ? state.close : null }); usePreventScroll({ diff --git a/packages/react-aria-components/docs/SearchField.mdx b/packages/react-aria-components/docs/SearchField.mdx index 8d1389522cb..a372b011da3 100644 --- a/packages/react-aria-components/docs/SearchField.mdx +++ b/packages/react-aria-components/docs/SearchField.mdx @@ -78,6 +78,7 @@ import {SearchField, Label, Input, Button} from 'react-aria-components'; .react-aria-Input { grid-area: input; + width: 100%; padding: 0.286rem 1.714rem 0.286rem 0.286rem; margin: 0; border: 1px solid var(--border-color);