Skip to content

[combobox] Fix combobox attributes during SSR - #4179

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

atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/combobox-ssr-aria

Conversation

@atomiks

@atomiks atomiks commented Feb 24, 2026 •

Copy link
Copy Markdown
Contributor

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

pkg-pr-new Bot commented Feb 24, 2026 •

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

  • vite-css-base-ui-example

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

commit: 23a3e71

@mui-bot

mui-bot commented Feb 24, 2026 •

Copy link
Copy Markdown

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

netlify Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

✅ 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

atomiks commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

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
6 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