Skip to content

Modal closes when suspended and closeTimeoutMS is set #1063

@tstehr

Description

@tstehr

Summary

When a ReactModal is inside a Suspense component in React 18 and closeTimeoutMS is set, the modal will close when suspended, and not reopen afterwards, even if isOpen is still true.

Steps to reproduce

Open this codepen: https://codepen.io/MentalShirt/pen/vELvLyr?editors=0010

Expected behavior

  1. The modal is shown
  2. It then vanishes briefly while a "Loading" text is visible. The loading text is the fallback of the Suspense component, which is shown because a component is loaded in lazily.
  3. It's then shown again as soon as it is unsuspended.

Actual behavior

  1. The modal is shown
  2. It then vanishes while a "Loading" text is visible.
  3. It stays closed even after the load is finished and the other components in the Suspense unsuspend

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