You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overlay stays open when its exit animation is cancelled (regression of #8786 in 3.53.0) #10772
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.
Activity
nwidynski commentedon Oct 14, 2026
Good catch and thanks for reporting! Possible solution sounds good to me if you want to pick it up.
pete-woods commentedon Oct 15, 2026
Okay, I think it's just this relatively small change here in the end: #10783
fix: unmount overlays when their exit animation is cancelled
fix: unmount overlays when their exit animation is cancelled