Attach <Dropdown.Content /> to a dynamically rendered element #1864
-
I need to be able to attach my Right now I have two ways to position the
Approach 1.DropdownMenu.js <DropdownMenu.Root>
<DropdownMenu.Trigger />
<DropdownMenu.Portal>
<DropdownMenu.Content>
<MenuItem1/>
<MenuItem2/>
<MenuItem3/>
</DropdownMenu.Content>
</DropdownMenu.Portal>
</DropdownMenu.Root> I see the problem with my code here, The Trigger is in Approach 2.I get a prop called Here is the result: it is almost good in that it is rendered around the correct element but then again it has become a part of the editor and not something attached to it. Both of these don't seem to fit my use case. Is there an other to accomplish this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I think a |
Beta Was this translation helpful? Give feedback.
-
Yeah it looks like you're after some kind of combobox/autocomplete component which we currently don't have. |
Beta Was this translation helpful? Give feedback.
Yeah it looks like you're after some kind of combobox/autocomplete component which we currently don't have.
Ariakit has an example close to that using their combobox hooks: https://ariakit.org/examples/combobox-textarea