Skip to content

[combobox] Fix highlight change reason in ChipRemove - #3980

Merged
atomiks merged 2 commits into
mui:masterfrom
sai6855:combobox-pointer
Feb 5, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
sai6855:combobox-pointer

Conversation

@sai6855

@sai6855 sai6855 commented Feb 5, 2026 •

Copy link
Copy Markdown
Member

Fix type handling in ComboboxChipRemove component

@pkg-pr-new

pkg-pr-new Bot commented Feb 5, 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@3980
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3980
    

commit: bf4b65f

@mui-bot

mui-bot commented Feb 5, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) ▼-5B(0.00%)

Details of bundle changes


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

@netlify

netlify Bot commented Feb 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit bf4b65f
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69846bf121863b00087f6b6c
😎 Deploy Preview https://deploy-preview-3980--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.

store.state.setIndices({
activeIndex: null,
type: store.state.keyboardActiveRef.current ? 'pointer' : 'keyboard',
type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was going through code of ComboBox, noticed slight descripency, In
https://github.com/sai6855/base-ui/blob/48c6258422710b995d2b3fcb4e1ef766dec23612/packages/react/src/combobox/input/ComboboxInput.tsx#L246
type is set to keyboard if store.state.keyboardActiveRef.current is true but here it's set to pointer

@sai6855 sai6855 added type: bug It doesn't behave as expected. component: combobox Changes related to the combobox component. labels Feb 5, 2026
@sai6855
sai6855 marked this pull request as ready for review February 5, 2026 10:06
@sai6855
sai6855 requested review from Copilot and mj12albert February 5, 2026 10:06
@greptile-apps

greptile-apps Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Corrected inverted boolean logic in ComboboxChipRemove component's type handling. Previously, when keyboardActiveRef.current was true (indicating keyboard interaction), the code incorrectly set type: 'pointer', and vice versa. The fix aligns this component with the pattern used consistently throughout the codebase in ComboboxInput.tsx and other combobox components.

Confidence Score: 5/5

  • This PR is safe to merge - it fixes a clear logic bug with no side effects
  • The change corrects an obvious inverted boolean condition, matching the established pattern used throughout the codebase. The fix is minimal, focused, and directly addresses the type handling bug described in the PR title.
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/combobox/chip-remove/ComboboxChipRemove.tsx Fixed inverted logic in type handling - correctly sets 'keyboard' when keyboard is active, 'pointer' otherwise

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug in the ComboboxChipRemove component where the interaction type was incorrectly determined. The component was setting type: 'pointer' when keyboard was active and type: 'keyboard' when pointer was active, which is the opposite of the intended behavior.

Changes:

  • Corrected the ternary expression in the onClick handler to properly map keyboardActiveRef.current to the interaction type
  • Applied the same fix to the onKeyDown handler for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@atomiks atomiks changed the title [combobox] Fix type handling in ComboboxChipRemove component [combobox] Fix highlight change reason in ChipRemove Feb 5, 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!

@atomiks
atomiks merged commit 1f0ec62 into mui:master Feb 5, 2026
7 checks passed
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.

4 participants