ui
ui copied to clipboard
How to keep toast and DropdownMenu open while processing a request?
If I click on a ToastAction to make a request in my database, the toast disappears immediately. I'm trying to keep the toast open until the request is completed.
In the same vein, I have a DropdownMenu with buttons to make requests in my database, but after clicking on one of them, the DropdownMenu closes without waiting for the request to be completed.
Thank you in advance!
Have you tried setting manually the open and onOpenChange while you are waiting for a response from the database?
You can find the api documentation here: https://www.radix-ui.com/primitives/docs/components/toast#root https://www.radix-ui.com/primitives/docs/components/dropdown-menu#api-reference
Many shadcn/ui components are extending the Radix UI components, so check out their docs too
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.