Skip to content

Is it expected behavior that the Promise returned by openAsync never resolves when unmount is called? #169

Open
@DongGukMon

Description

@DongGukMon

I’ve verified that calling close does resolve the Promise.
However, when isOpen isn’t managed inside the OverlayControllerComponent, a typical pattern would be to control the overlay by calling only unmount, without invoking close. In that scenario, I’m concerned that openAsync might never resolve, which could lead to unexpected behavior. Is it intentional that the Promise can be resolved only by calling close? If so, is the recommended best practice to always call close before invoking unmount?

If the current behavior isn’t intentional, I’d like to suggest two possible approaches:

Option 1.
Resolve the openAsync Promise when unmount is called.

Option 2.
Have the component mounted by openAsync resolve the Promise in a cleanup routine when it is unmounted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions