ui
ui copied to clipboard
How to to make sheet open but inside dropdown menu
How to to make sheet open but inside dropdown menu? Im trying but the sheet imidietly close. thank you.
Hello, I had the same issue and I fixed it by changing the <Sheet> root component to the top of the <DropdownMenu> component.
Don't forget to add the modal={false} to the <DropdownMenu> or the Sheet will toggle "pointer-events:none;" on <body> and the page will not have events after closing the sheet
<Sheet>
<DropdownMenu modal={false}>
<DropdownMenuTrigger>
<>
<span className="sr-only">Open menu</span>
<MoreHorizontal className="h-4 w-4" />
</>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="p-2">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuItem>
<SheetTrigger>Edit</SheetTrigger>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<SheetContent>...</SheetContent>
</Sheet>
Got somewhat the same issue when trying to trigger a modal when a dropdown element was "active", this triggered "pointer-events:none;" on body. Applied modal={false} and fixed the problem!
Nice, thanks Floriaaan!
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
Any idea how can i have a dropdownmenu with two or more options, and each option open a different sheet modal? For example: when clicking on options it triggers the dropdownmenu which has: 1. new incidence, 2. edit selected incidence, 3. modify status. Each option should trigger different sheets forms.
@Acapovilladev did you figure this out? facing the same issue
im having the same issue opening a sheet from a dropdown menu item. sheet closes automatically
@Acapovilladev did you solve it? I also would like to open different sheets based dropdown menu item selected.
I solved the problem of open different sheets using a popover instead of dropdown menu.
The single problem is the popover don't close on open the sheet