ui: Page becomes unresponsive after closing a modal
I want a dropdown-menu with two options: delete and edit, When the user selects an option, a popover will show to confirm his selection.
I know we shouldn’t put the dialog inside the dropdown menu other wise the popover will not even be vissible on the page, but I also had another issue: the page becomes unresponsive after a modal is closed. This is a video of the issue; the code is copied from the examples/playground page, where it functions properly.
i have this probleme only when when the modal is opened from a dropdown
thanks yall
https://github.com/shadcn-ui/ui/assets/93702837/287bc707-df04-4831-a31c-f25e9e3a3ddf
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Reactions: 2
- Comments: 15
This issue is still present, and manually managing state is not a viable solution imo.
hi all,
I just found a solution: https://github.com/radix-ui/primitives/issues/837#issuecomment-1455160154
here’s a example of shadcn-ui:
Two main points:
event.preventDefault();in theDropdownMenuItem. This actually prevents the dialog closing due to the dropdown menu closing.AlertDialoginDropdownMenuContent