-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popup closing Modal?? #2147
Comments
I think, you're forgot to put your testcase in jsfiddle or codepen ? |
Likely a duplicate of #1580. Please provide the requested codepen for testing, fork this http://codepen.io/levithomason/pen/ZpBaJX. Will reopen if we get a codepen and confirmation that this is not a duplicate. |
Thanks, through the issues here I figured out I needed to use |
Not fixed at all. I tried many hacks to solve this but I have issues all around.
This would prevent modals from being closed but popup still remains open then. In any other case, modal always gets closed when popup is closed (even tho both are controlled components). They are totally separated components, but perhaps in the background semantic-ui-react uses shared state or something. So solution for me was to write my own modal component from scratch... 😞 |
This isn't a duplicate and it still exists. Passing https://codepen.io/anon/pen/KEoOqE It could be entirely possible that it is working as intended and we're just assumed to not try to nest things inside of popups. Idk. |
@crwdzr it is very likely that parent component unmounts, therefore there is no way to prevent your child (popup) component to unmount as well. |
That's what my assumption was too. I would say that it's also largely because it's not possible for the popup to ignore clicks in things being rendered out through portals. That would explain why nesting of multiple popups, although listed as a feature in the docs, doesn't actually work with The workaround is to control the state of the modal in a parent of the popup, render the modal along side the popup, and then place the trigger inside of the popup. That will get you the expected behavior for really simple use cases, but that doesn't make a lot of sense to me. That causes logic that should stay separate to end up in the same location, even if you try to hide it using something like redux or a context. At the risk of sounding like I'm too greedy, I would expect the library to handle that on its own. I wanted to add that a rather ugly but by far the simplest way to hack this into working is treating it kind of like a HOC: |
Still not fixed? |
Steps
I have a popup that has a edit button that then when clicked opens up a modal with a form in it to edit that thing. Here is the popup code:
Expected Result
For the popup to stay open or even close, idc about that, but once the modal opens I can click around on it and edit it and submit the form.
Actual Result
If I click anywhere, the modal and popup close. I'm thinking this has to do with the popup closing since I clicked away and for some reason this closes the modal as well.
Version
0.74.2
Testcase
The text was updated successfully, but these errors were encountered: