Skip to content

[combobox] Fix combobox attributes during SSR#4179

Merged
atomiks merged 2 commits intomui:masterfrom
atomiks:codex/combobox-ssr-aria
Mar 3, 2026
Merged

[combobox] Fix combobox attributes during SSR#4179
atomiks merged 2 commits intomui:masterfrom
atomiks:codex/combobox-ssr-aria

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Feb 24, 2026

Ensures the attributes are present before hydration. <Combobox.Trigger> has an existing mismatch if it's not inside the popup, but the issue is minor and can be worked around externally

@atomiks atomiks requested a review from colmtuite as a code owner February 24, 2026 06:56
@atomiks atomiks added the type: bug It doesn't behave as expected. label Feb 24, 2026
@atomiks atomiks requested a review from michaldudak as a code owner February 24, 2026 06:56
@atomiks atomiks added the component: combobox Changes related to the combobox component. label Feb 24, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

commit: 23a3e71

@mui-bot
Copy link

mui-bot commented Feb 24, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+16B(0.00%) 🔺+8B(+0.01%)

Details of bundle changes


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

@netlify
Copy link

netlify bot commented Feb 24, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit b86db0d
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69a6cdfc2f2c9b0009ae0025
😎 Deploy Preview https://deploy-preview-4179--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@atomiks
Copy link
Contributor Author

atomiks commented Mar 3, 2026

Codex Review

Overview

This PR ensures Combobox ARIA attributes are present during SSR and initial hydration when the input ref is not yet available. It also adds targeted server-rendering tests to lock in expected combobox attributes for input-based and trigger-based configurations.

Findings (None)

No blocking issues found in this patch.

Confidence: 4/5

The behavioral change is small, directly addresses the SSR ref-timing gap, and is backed by focused regression tests on the relevant attribute paths.

Notes

  • packages/react/src/combobox/root/AriaCombobox.tsx:969 introduces shouldTreatAsInput so SSR applies combobox ARIA attributes before the input element ref is populated.
  • packages/react/src/combobox/root/ComboboxRoot.test.tsx:96 adds SSR regression coverage for default input mode and trigger-based mode.

@atomiks atomiks merged commit 1baf176 into mui:master Mar 3, 2026
22 checks passed
@atomiks atomiks deleted the codex/combobox-ssr-aria branch March 3, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants