Skip to content

[collapsible] Fix trigger and panel state bugs#4848

Open
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/collapsible-bug-fixes
Open

[collapsible] Fix trigger and panel state bugs#4848
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/collapsible-bug-fixes

Conversation

@atomiks
Copy link
Copy Markdown
Contributor

@atomiks atomiks commented May 19, 2026

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
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

commit: 75a47d7

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 19, 2026

Bundle size

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

Details of bundle changes

Performance

Total duration: 1,064.21 ms -224.60 ms(-17.4%) | Renders: 50 (+0) | Paint: 1,617.88 ms -358.07 ms(-18.1%)

Test Duration Renders
Slider mount (300 instances) 146.88 ms ▼-58.07 ms(-28.3%) 3 (+0)
Checkbox mount (500 instances) 60.40 ms ▼-39.27 ms(-39.4%) 1 (+0)
Scroll Area mount (300 instances) 76.10 ms ▼-21.03 ms(-21.7%) 3 (+0)

9 tests within noise — details


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

@netlify
Copy link
Copy Markdown

netlify Bot commented May 19, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 75a47d7
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a0befe97f059a0008bf227f
😎 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
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