Skip to content

Keep track of the stack of opened Modals #184

@Victor-ARC

Description

@Victor-ARC

Hi,
Is there a way to keep track of the modals that are open?

Here's my use case.
I'm working with React Suite, which gives me a nice UI for modals, drawers, etc. However, when I call multiple modals, and specially when I mix Drawer and Modal, the backdrop ends up way behind the other modals.

So, I figured, if Nice Modal gave me the current stack, I could compute the correct z-index for each new modal, specially since hardly any older modal would be closed before the newest (at which point that would be my job to ensure that doesn't happen).

Is this possible through the context API on which Nice Modal relies? Is it a good feature to have added?

P.s.: If NIce Modal computed the z-index based on a configurable setting on the provider or something, that would be great too, but I guess that should be the UI's job, not NM's.

Thanks in advance!

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