Closing a nested modal that has a canvas element closes the parent modal as well
See original GitHub issueSteps
- make nested modals with a button to close the inner one
- put a
canvas
element in the child modal - clicking the nested modal’s close button closes the parent modal as well
Expected Result
closing the nested modal shouldn’t close the parent modal
Version
0.79.1
Testcase
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
React: How to close a modal from child opened from parent ...
I am opening child component modal by passing parent state as props to child. Is there any way to close the modal from...
Read more >The Dialog element - HTML: HyperText Markup Language
showModal () to open a <dialog> , focus is set on the first nested focusable element. Ensure a mechanism is provided to allow...
Read more >Click Outside Modal - Beginner JavaScript - Wes Bos
In this lesson we are going to learn how to check whether you clicked outside an element, which kind of tough. Let's look...
Read more >Popup | Workday Canvas Design System
Popup components are generally used in place of Non-Modal Dialogs. ... out of the Popup will close the Popup and move focus to...
Read more >How to capture a frame from HTML Canvas and display it on ...
modal header: This is the top portion of the modal. To make this, we use a class called modal-header. It consists of a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see. Thank you for pushing the issue a bit as I was not only wrong about the canvas but also about the order of the state updates. Apologies!
It seems any other element besides a canvas (e.g.
<p />
) does not cause this problem. Moreover, placing the canvas anywhere else, besides inside the second modal, also does not cause this problem.This smells like a React issue but I’d really like to know why the
<canvas />
element is magical and why it must be a child of the second modal. This just seems so strange.https://codesandbox.io/s/my8lw043op
Tested with latest SUIR and React, works as it should 🌟