Skip to content

[collapsible] Fix trigger and panel state bugs - #4848

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/collapsible-bug-fixes
May 27, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/collapsible-bug-fixes

Conversation

@atomiks

@atomiks atomiks commented May 19, 2026

Copy link
Copy Markdown
Contributor

Fix a few Collapsible edge cases and intentionally add the missing regression coverage alongside the fixes.

Root cause

A few paths missed small state checks: the trigger destructured id before forwarding props, initially open panels only cleared mount-animation suppression on one close path, and beforematch opened before honoring canceled change details.

Changes

  • Forward id from Collapsible.Trigger.
  • Clear open-animation suppression whenever a panel starts closing so later reopens can animate even without close keyframes.
  • Honor eventDetails.cancel() for hiddenUntilFound beforematch opens before setting skip/open state.
  • Add focused coverage for disabled interactions, controlled and canceled trigger presses, state callbacks, opening starting style, public type exports, and the repaired animation and beforematch cases.

@atomiks atomiks added type: bug It doesn't behave as expected. component: collapsible Changes related to the collapsible component. labels May 19, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 19, 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@4848
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4848
    

commit: a2de464

@code-infra-dashboard

code-infra-dashboard Bot commented May 19, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-3B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

Total duration: 1,039.96 ms -57.22 ms(-5.2%) | Renders: 50 (+0) | Paint: 1,580.64 ms -67.69 ms(-4.1%)

Test Duration Renders
Slider mount (300 instances) 138.60 ms ▼-37.42 ms(-21.3%) 3 (+0)
Tooltip mount (300 contained roots) 41.99 ms ▼-18.46 ms(-30.5%) 1 (+0)

10 tests within noise — details


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

@netlify

netlify Bot commented May 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit a2de464
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a1699dae69677000890aeb5
😎 Deploy Preview https://deploy-preview-4848--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 marked this pull request as ready for review May 19, 2026 05:05
@atomiks
atomiks force-pushed the codex/collapsible-bug-fixes branch from f5773b2 to 75a47d7 Compare May 19, 2026 05:06

atomiks commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Code Review (GPT-5.5)

Approve ✅ No actionable issues remain; the Collapsible bug-fix paths are narrowly patched and covered by focused runtime and type validation.

1. Bugs / Issues (None)

Root Cause & Patch Assessment

The changes address the concrete state bugs: canceled beforematch no longer mutates Base UI open state, one-shot animation suppression is cleared on close regardless of close animation type, and Collapsible.Trigger now forwards id through normal element props.

Test Coverage Assessment

I ran pnpm test:jsdom Collapsible --no-watch, pnpm test:chromium Collapsible --no-watch, and pnpm typescript; all passed. The added tests cover trigger id forwarding, disabled/canceled trigger behavior, controlled state, state callback props, canceled beforematch, and transition/keyframe reopen behavior.

@atomiks
atomiks merged commit e18d788 into mui:master May 27, 2026
6 checks passed
@atomiks
atomiks deleted the codex/collapsible-bug-fixes branch May 27, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: collapsible Changes related to the collapsible component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant