diff --git a/src/components/menu/Menu.tsx b/src/components/menu/Menu.tsx index 6206e57a..67695fc3 100644 --- a/src/components/menu/Menu.tsx +++ b/src/components/menu/Menu.tsx @@ -1,6 +1,12 @@ import { Menu as HeadlessMenu } from '@headlessui/react' import { Fragment, ReactElement, ReactNode, ReactPortal } from 'react' -import { autoUpdate, useFloating, flip, offset } from '@floating-ui/react' +import { + autoUpdate, + useFloating, + flip, + offset, + FloatingPortal, +} from '@floating-ui/react' import classNames from 'classnames' import { useTheme } from '../../framework' import { remToPx } from '../util/remToPx' @@ -74,13 +80,17 @@ export function Menu({ className, children, button, placement }: MenuProps) { }) : button} - - {children} - + {open && ( + + + {children} + + + )} )} diff --git a/src/examples/Menu.stories.tsx b/src/examples/Menu.stories.tsx index 2d3b491f..fb26767e 100644 --- a/src/examples/Menu.stories.tsx +++ b/src/examples/Menu.stories.tsx @@ -36,10 +36,17 @@ const meta = { }, []) return ( -
-
-
- +
+
+
+
+ Container with "overflow: hidden" +
+
+
+ +
+