Description
Prequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
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?