Replies: 3 comments 5 replies
-
You can do this by rendering the An example of those can be seen here: https://github.com/tailwindlabs/headlessui/blob/main/packages/playground-react/pages/menu/menu-with-popper.tsx |
Beta Was this translation helpful? Give feedback.
-
How does this work for Vue? |
Beta Was this translation helpful? Give feedback.
-
Not sure if you resolved this already, but I managed to solve a similar issue by using the headlessui-float library. Here I use the import { Float } from '@headlessui-float/react';
import { Listbox, Dialog } from '@headlessui/react';
export const Example = (props: Props) => {
return (
<Dialog
as="div"
className="relative"
initialFocus={props.initialFocus}
onClose={() => props.onClose()}
>
{/** Whatever dialog styling you want here */}
<Listbox value={selected} onChange={onChange}>
{({ open }) => (
<Float
as="div"
className="relative"
placement="bottom"
offset={4}
floatingAs={Fragment}
>
<Listbox.Button
className={}
>
</Listbox.Button>
<Listbox.Options className="">
{options.map((option, idx) => (
<Listbox.Option
key={idx}
className={}
value={version}
>
{({ selected, active }) => (
{/** Options */}
)}
</Listbox.Option>
))}
</Listbox.Options>
</Float>
)}
</Listbox>
</Dialog>
)
}; With this setup, I was able to have the listbox options render on top of any elements in the dialog without causing the dialog to grow in height. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v1.6.6
What browser are you using?
Chrome
Reproduction URL
https://stackblitz.com/edit/vitejs-vite-mgedky?file=src/App.jsx
https://headlessui.com/react/listbox
https://headlessui.com/react/dialog
Describe your issue
When open the dropdown the list is cut off by the modal window.
Expected: the dropdown goes over the modal window.
Beta Was this translation helpful? Give feedback.
All reactions