Skip to content

[all components] Fix animation waits retaining detached elements - #5719

Merged
atomiks merged 5 commits into
mui:masterfrom
flaviendelangle:fix-animation-wait-retention
Sep 15, 2026
Merged

atomiks merged 5 commits into
mui:masterfrom
flaviendelangle:fix-animation-wait-retention

Conversation

@flaviendelangle

Copy link
Copy Markdown
Member

An infinite animation in a ScrollArea subtree keeps its animation wait pending, retaining completed animations and their detached targets. The shared useAnimationsFinished hook also waits indefinitely when the watched element has an infinite animation, blocking completion callbacks across components.

Exclude infinite animations from both waits using a shared helper, and discard fulfilled Animation values before aggregating promises. Discarding the values also prevents completed targets from being retained while a finite animation stays paused. Preserve the shared hook's cancellation and replacement-animation handling.

Add regression coverage for mixed finite/infinite animations, infinite-only animations, and cancellation with replacement animations. Isolate the ScrollArea animation test from ResizeObserver updates so they cannot mask a broken wait.

Validation:

  • 663 Chromium tests and 507 jsdom tests passed across ScrollArea, the shared hook, and component suites.
  • Production-build Chromium reproduction with forced garbage collection confirmed detached targets are collected while an infinite or paused animation continues.
  • TypeScript, ESLint, Stylelint, and Prettier passed.

Fixes #5718.

@pkg-pr-new

pkg-pr-new Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5719
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5719
    

commit: 3b7ff40

@flaviendelangle flaviendelangle added type: bug It doesn't behave as expected. scope: all components Widespread work has an impact on almost all components. labels Sep 14, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+111B(+0.02%) 🔺+32B(+0.02%)

Details of bundle changes

Performance

Total duration: 972.28 ms -14.07 ms(-1.4%) | Renders: 76 (+0) | Paint: 1,576.97 ms -8.86 ms(-0.6%)

No significant changes — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 3b7ff40
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6aa89606159c6a0008c84c6c
😎 Deploy Preview https://deploy-preview-5719--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks merged commit 87b2a9f into mui:master Sep 15, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: all components Widespread work has an impact on almost all components. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ScrollArea] Pending animation wait retains detached targets of completed animations

2 participants