-
Notifications
You must be signed in to change notification settings - Fork 230
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested modals don't close properly via JS api #515
Comments
Confirmed: I've got a workaround in my situation. I'm changing things so that when a second modal is opened, it closes the first. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an situation where I need to nest modals (I know... nested modals 馃槺).
In my app, showing the second modal works fine, and it closes properly. However, once it is closed, the first modal won't close.
I found this codepen someone created, which demonstrates this should be possible: https://codepen.io/badfeather/pen/NWbBbYP So I was very confused why it didn't work in my app.
After a bunch of digging, I think I figured out what is happening. In that codepen, the open/close functionality is controlled via the built-in closeTrigger functionality. In my case, I am doing it via
MicroModal.close
. In devtools, I can see that the event listener is removed from the first modal. I believe it is caused by this line: https://github.com/HongPong/Micromodal/blob/35723741398857305c85bba52fd431cd0f88e8c1/lib/src/index.js#L313I'm about to try to push back on my designers to see if I can get rid of the nested modal, but I figured I'd report the issue here.
The text was updated successfully, but these errors were encountered: