question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closing a nested modal that has a canvas element closes the parent modal as well

See original GitHub issue

Steps

  1. make nested modals with a button to close the inner one
  2. put a canvas element in the child modal
  3. 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

https://codesandbox.io/s/znx91x17q4

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
levithomasoncommented, Apr 27, 2018

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.

0reactions
layershiftercommented, Jan 28, 2019

https://codesandbox.io/s/my8lw043op

Tested with latest SUIR and React, works as it should 🌟

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found