Skip to content

Commit

Permalink
remove portal component arround menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
mollpo committed Oct 23, 2024
1 parent d530d19 commit 15a449d
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
FloatingPortal,
autoUpdate,
flip,
offset,
useFloating,
} from '@floating-ui/react'
import { autoUpdate, flip, offset, useFloating } from '@floating-ui/react'
import {
Menu as HeadlessMenu,
MenuButton as HeadlessMenuButton,
Expand Down Expand Up @@ -85,15 +79,13 @@ export function Menu({ className, children, button, placement }: MenuProps) {
: button}
</HeadlessMenuButton>
{open && (
<FloatingPortal>
<HeadlessMenuItems
ref={refs.setFloating}
className={menu.list.base}
style={floatingStyles}
>
{children}
</HeadlessMenuItems>
</FloatingPortal>
<HeadlessMenuItems
ref={refs.setFloating}
className={menu.list.base}
style={floatingStyles}
>
{children}
</HeadlessMenuItems>
)}
</>
)}
Expand Down

0 comments on commit 15a449d

Please sign in to comment.