Replies: 1 comment 4 replies
-
Hi! I create a package Headless UI Float, that can be easy to position floating Headless UI elements using Floating UI (is new version Popper.js), support Transition & Portal. If you need to float Headless UI element can try it out 😊 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice if dropdown menus could support portals like panels.
A use-case I've ran into a dropdown menu being cut-off by an ancestor's overflow-x hidden; by moving the rendering root to the body, the overflow-x: hidden wouldn't affect the rendering of the menu.
A similar library to headless that supports this is https://www.radix-ui.com/docs/primitives/components/dropdown-menu
Edit: Digging a bit more into headlessui's codebase, there is a portal element that's used for dialogs: https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/components/portal/portal.tsx
Using this correctly still requires a positioning library e.g.
react-popover
though. Radix itself uses an internal positioning component in addition to their portal: https://github.com/radix-ui/primitives/tree/main/packages/react/popper/srcBeta Was this translation helpful? Give feedback.
All reactions