Skip to content

[combobox] Improved focus behavior for disabled and readOnly cases. - #4044

Merged
atomiks merged 5 commits into
mui:masterfrom
jijiseong:fix/diabled-combobox-chip
Feb 11, 2026
Merged

atomiks merged 5 commits into
mui:masterfrom
jijiseong:fix/diabled-combobox-chip

Conversation

@jijiseong

@jijiseong jijiseong commented Feb 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4041

Summary

Improved focus behavior for disabled and readOnly cases on ComboboxChip click.

When the prop is:

  • disabled: the chip should not receive focus
  • readOnly: the chip should receive focus

Changes

@pkg-pr-new

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

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

  • vite-css-base-ui-example

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

commit: 889fae5

@mui-bot

mui-bot commented Feb 11, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+1B(0.00%) 🔺+4B(0.00%)

Details of bundle changes


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

@netlify

netlify Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 889fae5
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/698c6c35d5701f0008836cb4
😎 Deploy Preview https://deploy-preview-4044--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.

@jijiseong
jijiseong marked this pull request as ready for review February 11, 2026 07:36
@jijiseong jijiseong changed the title [combobox] prevent focus on chip click when combobox is disabled [combobox] Improved focus behavior for disabled and readOnly cases. Feb 11, 2026
@greptile-apps

greptile-apps Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR updates Combobox.Chip mouse handling to align disabled vs readOnly focus behavior in multi-select comboboxes.

  • disabled: onMouseDown now calls preventDefault() and returns, which blocks the chip element from receiving focus via click.
  • readOnly: onMouseDown now returns without preventDefault(), allowing the browser default behavior (chip receives focus) while still keeping keyboard-based deletion/navigation blocked.

Tests were added to cover both cases: disabled chips should not gain focus on click, and readOnly chips should gain focus on click.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are narrowly scoped to chip mouse-down behavior and are directly covered by new focused tests for disabled and readOnly scenarios. No behavioral regressions were identified in the updated event handler logic.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/combobox/chip/ComboboxChip.tsx Adjusts chip onMouseDown: allow default focus for readOnly, call preventDefault when disabled to block chip focus and when enabled to focus input.
packages/react/src/combobox/chip/ComboboxChip.test.tsx Adds tests asserting disabled chips don’t receive focus on click and readOnly chips do receive focus on click.

@atomiks atomiks added type: bug It doesn't behave as expected. component: combobox Changes related to the combobox component. labels Feb 11, 2026

@atomiks atomiks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix @jijiseong

@atomiks
atomiks merged commit 8e7d115 into mui:master Feb 11, 2026
7 checks passed
@jijiseong
jijiseong deleted the fix/diabled-combobox-chip branch February 12, 2026 20:02
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.

[combobox] Chip is focusable when Root is disabled

3 participants