Skip to content
Discussion options

You must be logged in to vote

I recently ran into this issue with BubbleMenu and RadixUI dropdown. Setting the container in DropdownMenu container to the BubbleMenu ref seems to work for me: https://www.radix-ui.com/primitives/docs/components/dropdown-menu#portal.

  1. Wrap BubbleMenu items:
const containerRef = useRef(null);
...
return (
  <BubbleMenu ...>
    <div ref={containerRef}>{menuItems}</div>
  </BubbleMenu>
)
  1. Pass the ref to DropdownMenu Portal
<DropdownMenu.Portal container={containerRef.current}>{items}</DropdownMenu.Portal>

Hope that helps.

Replies: 6 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@danigo99
Comment options

Comment options

You must be logged in to vote
2 replies
@raihan-ramadhan
Comment options

@Jonathan-Hofmann
Comment options

Answer selected by bdbch
Comment options

You must be logged in to vote
1 reply
@damien-schneider
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bdbch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants