Skip to content

When a modal is closed, it's hidden rather than removed #258

Description

@oddsson

When a modal is closed, it's hidden rather than removed

When calling ModalController.closeByComponent, the modal window is hidden rather than removed.

Having "leftovers" of a hidden modal window causes issues when using other 3rd party tools, in addition to being a code-smell. In our case, we are using Reakit's menu component when opening a modal window.

Reproduction Steps

  1. Setup a project with a menu component from Reakit.
  2. One of the menu items should open a modal window with react-modal-global.
  3. Open a modal window.
  4. Close the modal window.
  5. Try to open a modal window again.

Expected Behavior

The menu items should not disappear.

Additional Context

In the following video, you can see better what I mean

Screen.Recording.2024-04-03.at.14.58.47.mov

What happens when using Reakit's menu component

Screen.Recording.2024-04-03.at.15.00.18.mov

I believe this is what's causing this behaviour. Could you please clarify this was added?

Thank you for your time 🙏☺️

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions