Skip to content

Commit 72cc97e

Browse files
committed
UI: Ensure Select sets body inert
1 parent 56e12cf commit 72cc97e

File tree

1 file changed

+7
-1
lines changed
  • code/core/src/components/components/Select

1 file changed

+7
-1
lines changed

code/core/src/components/components/Select/Select.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState }
44
import { RefreshIcon } from '@storybook/icons';
55

66
import { useInteractOutside } from '@react-aria/interactions';
7-
import { Overlay, useOverlay, useOverlayPosition } from '@react-aria/overlays';
7+
import { Overlay, ariaHideOutside, useOverlay, useOverlayPosition } from '@react-aria/overlays';
88
import { useObjectRef } from '@react-aria/utils';
99
import { useOverlayTriggerState } from '@react-stately/overlays';
1010
import { darken, transparentize } from 'polished';
@@ -142,6 +142,12 @@ const MinimalistPopover: FC<{
142142
onInteractOutside: handleClose,
143143
});
144144

145+
useEffect(() => {
146+
if (popoverRef.current) {
147+
return ariaHideOutside([popoverRef.current], { shouldUseInert: true });
148+
}
149+
}, [popoverRef]);
150+
145151
const { overlayProps: positionProps } = useOverlayPosition({
146152
targetRef: triggerRef,
147153
overlayRef: popoverRef,

0 commit comments

Comments
 (0)