Skip to content

Overlay stays open when its exit animation is cancelled (regression of #8786 in 3.53.0) #10772

Open

Description

@pete-woods

Provide a general summary of the issue here

Since react-aria 3.53.0 / react-aria-components 1.22.0, an overlay (Modal, Popover) whose exit animation is cancelled never unmounts. This looks like a regression of #8786, which #9772 fixed and #10674 undid.

🤔 Expected Behavior?

The overlay unmounts once its exit animations settle, whether they finish or are cancelled, as in 3.52.

😯 Current Behavior

The overlay stays in the DOM after closing with Escape, the backdrop or a close button.

💁 Possible Solution

useAnimation in packages/react-aria/src/utils/animation.ts now uses Promise.all([startPromise, ...animations.map(a => a.finished)]).then(onEnd).catch(() => {}). A cancelled animation rejects finished, so onEnd never runs. Switching back to Promise.allSettled, as #9772 did, fixes it.

🔦 Context

Found when upgrading from 3.52.1 to 3.53.0: our modal and popover close tests began failing, and pass again with allSettled restored.

🖥️ Steps to Reproduce

Render a Modal or Popover with an exit animation, close it, and cancel the exit animation before it finishes (e.g. element.getAnimations().forEach(a => a.cancel())). The overlay never unmounts.

Version

react-aria 3.53.0 / 3.53.1, react-aria-components 1.22.0 / 1.22.1

What browsers are you seeing the problem on?

Chrome

What operating system are you using?

macOS

Activity

  1. nwidynski commented on Oct 14, 2026

    @nwidynski
    Contributor

    Good catch and thanks for reporting! Possible solution sounds good to me if you want to pick it up.

  2. pete-woods commented on Oct 15, 2026

    @pete-woods
    Author

    4. Good catch and thanks for reporting! Possible solution sounds good to me if you want to pick it up.

    Okay, I think it's just this relatively small change here in the end: #10783

  3. added 2 commits that reference this issue on Oct 20, 2026
    6687702
    eef23e0
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions