Skip to content

[tabs] Fix suspended panel activation#4903

Open
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/fix-tabs-suspense-panel
Open

[tabs] Fix suspended panel activation#4903
atomiks wants to merge 1 commit into
mui:masterfrom
atomiks:codex/fix-tabs-suspense-panel

Conversation

@atomiks
Copy link
Copy Markdown
Contributor

@atomiks atomiks commented May 25, 2026

Fixes #4880

Opening a tab whose panel suspends no longer makes Tabs treat the temporarily empty tab registry as real tab removal.

Root cause

Suspense can clean up tab registration effects while keeping the previous tab nodes connected, so the automatic missing-tab fallback reset the value before the suspended panel could resume. The connectivity check has to run from the root effect after the DOM settles; during a real unmount, unregister can run before React detaches the DOM node.

Changes

  • Track a previously registered tab element and only commit the missing-tab fallback when that element is disconnected.
  • Add a React 19 Suspense regression test for opening a suspending panel with the boundary outside Tabs.Root.

@atomiks atomiks added component: tabs Changes related to the tabs component. type: regression A bug, but worse, it used to behave as expected. labels May 25, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

commit: 165a731

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 25, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+67B(+0.01%) 🔺+35B(+0.02%)

Details of bundle changes

Performance

Total duration: 1,258.66 ms +48.31 ms(+4.0%) | Renders: 50 (+0) | Paint: 1,920.31 ms +93.43 ms(+5.1%)

Test Duration Renders
Checkbox mount (500 instances) 123.43 ms 🔺+22.78 ms(+22.6%) 1 (+0)

11 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 25, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 165a731
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a13e9e3f1f5920008aca1e6
😎 Deploy Preview https://deploy-preview-4903--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 force-pushed the codex/fix-tabs-suspense-panel branch from aa3bcc6 to 165a731 Compare May 25, 2026 06:19
@atomiks atomiks marked this pull request as ready for review May 25, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: tabs Changes related to the tabs component. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tabs] Tabs.Panel content not rendered if a child component suspends without boundary within Tabs.Root

1 participant