Skip to content

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

Closed
@puopg

Description

@puopg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions