Trigger a modal from a dropdown #2008
-
Hey experts! I am currently working on building a todo application, and what I would like to do is have each todo in a card. In that card header I want to have a dropdown menu trigger (using a NextUI Dropdown), the dropdown menu items will be for Edit and Delete actions, the buttons for these will trigger a modal popup (using a NextUI Modal). The issue I currently have is that I click the dropdown menu item, the modal pops up, but disappears almost instantly. I cannot find a way to make this work? I was trying to use the components in NextUI as much as possible so I don't need to build out my own functionaity. Any help is greatly appreaciated. I currently have this:
The EditModal for example is:
And GlobalModal is:
---Edit--- |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
The docs say the
|
Beta Was this translation helpful? Give feedback.
-
Screencast.from.2023-11-22.19-40-29.webm@stefanwright1988 Having the same issue |
Beta Was this translation helpful? Give feedback.
-
Has anyone came to a workaround to this issue? |
Beta Was this translation helpful? Give feedback.
-
I just started running in to this myself. I'm using plenty of modals elsewhere in my project but the moment I attempt to do trigger opening one from the dropdown menu I get the same behavior as described. |
Beta Was this translation helpful? Give feedback.
@stefanwright1988 @theonlyway @thebashpotato Hey, i found a fix and its pretty simple, Just put the modal outside of dropdown