Skip to content
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

Modal will autoclose with an opened Portal #2446

Closed
FckYeah opened this issue Jan 18, 2018 · 9 comments
Closed

Modal will autoclose with an opened Portal #2446

FckYeah opened this issue Jan 18, 2018 · 9 comments

Comments

@FckYeah
Copy link

FckYeah commented Jan 18, 2018

Steps

  1. Create a <Modal /> with an onClose prop and a <Portal />.
  2. Keep opened <Portal />.
  3. Open <Modal />.

Expected Result

Modal should open.

Actual Result

Modal never will open. Modal uses Portal as a wrapper if I understand clearly. click event listener subs to all open modals and portals and pass through all of them. Since didClicknRootNodeClick has been changed here, <Modal /> handles a click in handleDocumentClick and recognizes it as click on dimmer. Everything is ok if <Modal /> will be without dimmer or <Modal />'s content will be right under a click point.

Version

0.77.2

Testcase

https://codesandbox.io/s/9y3wzpyjky

@rodolfoag
Copy link

Same happening here after upgrade to 0.77.2.

@b0gok
Copy link
Contributor

b0gok commented Feb 5, 2018

Is it related to this #2493 ?

@levithomason
Copy link
Member

Yes, this sounds like it is duplicated in #2493. See workarounds there. A fix is in the works.

@levithomason
Copy link
Member

I am releasing 0.78.1 right now with a proposed fix for this. Once it is live (~10 minutes), please update the codesandbox, try it, and report back.

@levithomason
Copy link
Member

Confirmed worked. Forked codesandbox here: https://codesandbox.io/s/328x7n20ym. I only needed to update to the latest 0.78.1 to get the fix.

Thanks for the reporting folks!

@b0gok
Copy link
Contributor

b0gok commented Feb 5, 2018

@levithomason it works for me too. Thank you for your work!

@amankkg
Copy link
Contributor

amankkg commented Jun 6, 2018

@levithomason seems like the issue is reproduced when the content of modal is changed. https://codesandbox.io/s/30n2v379r1 here is the example when changing one form with another - onClose is fired, it's important that the second form has more inputs, so markup very is different. Of course, workarounds are possible, but still.

@amankkg
Copy link
Contributor

amankkg commented Jun 6, 2018

@amankkg
Copy link
Contributor

amankkg commented Jun 7, 2018

OK, opened #2888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants