Skip to content

[select] Fix filled state in multiple mode#3608

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:fix/select-multiple-filled
Dec 28, 2025
Merged

[select] Fix filled state in multiple mode#3608
atomiks merged 2 commits into
mui:masterfrom
atomiks:fix/select-multiple-filled

Conversation

@atomiks

@atomiks atomiks commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

With multiple, the empty state is an empty array, not null.

Fixes #3610

@atomiks atomiks added the component: select Changes related to the select component. label Dec 24, 2025
@atomiks atomiks added the type: bug It doesn't behave as expected. label Dec 24, 2025
@pkg-pr-new

pkg-pr-new Bot commented Dec 24, 2025

Copy link
Copy Markdown
  • vite-css-base-ui-example

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

commit: 7c976c7

@mui-bot

mui-bot commented Dec 24, 2025

Copy link
Copy Markdown

Bundle size report

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

Details of bundle changes


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

@netlify

netlify Bot commented Dec 24, 2025

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 7c976c7
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6950c002e299ab000802a6b1
😎 Deploy Preview https://deploy-preview-3608--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.

it('does not add [data-filled] attribute when multiple value is empty', async () => {
const { user } = await renderFakeTimers(
<Field.Root>
<Select.Root multiple>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add test also when defaultValue={[]}?

@mnajdova mnajdova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, check one comment about potentially adding one more test.

@atomiks atomiks force-pushed the fix/select-multiple-filled branch from fa48d50 to 7c976c7 Compare December 28, 2025 05:28
@atomiks atomiks merged commit 3461165 into mui:master Dec 28, 2025
22 of 23 checks passed
@atomiks atomiks deleted the fix/select-multiple-filled branch December 28, 2025 05:32
atomiks added a commit to atomiks/base-ui that referenced this pull request Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[select] <Select.Root multiple> always has [data-filled=true], even when no options are selected

3 participants