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

bug: isDismissing on Overlay is scoped to exported IonModal class and not instances of the IonModal. #23904

Closed
4 of 6 tasks
puopg opened this issue Sep 8, 2021 · 4 comments · Fixed by #23903
Closed
4 of 6 tasks
Labels
package: react @ionic/react package type: bug a confirmed bug report
Milestone

Comments

@puopg
Copy link
Contributor

puopg commented Sep 8, 2021

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

Speaking on behalf of ionic/react: 5.7.0.

IonModal will mount child components even if isOpen is hardcoded to false due to the isDismissing flag on the createOverlayComponent HOC.

Expected Behavior

If IonModal isOpen is hardcoded to false, I would expect my child component NEVER gets mounted. Like why would it lol?

Steps to Reproduce

You need to have multiple IonModals being rendered. Then as you dismiss one using simple setState boolean toggles lets say, you will notice that other IonModals will see isDismissing as true, even if isOpen is hardcoded to false. And that causes the inner children to mount.

Code Reproduction URL

No response

Ionic Info

No response

Additional Information

I think this is due to the isDismissing flag being scoped to the createOverlayComponent and not the instance of the Overlay class / IonModal instance. Shouldn't each IonModal be independent of the others?

@ionitron-bot ionitron-bot bot added the triage label Sep 8, 2021
@puopg
Copy link
Contributor Author

puopg commented Sep 8, 2021

Obviously, I don't know if this is actually an oversight or a feature (if so I'd love to be enlightened what is the feature), but I figured I can link a simple fix if it actually is: #23903

@liamdebeasi
Copy link
Contributor

Thanks! You are correct, the isDismissing state should be unique to each instance of IonModal. I will take a look at your PR shortly.

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23903, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Oct 13, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: react @ionic/react package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants