Skip to content

[combobox] Prevent opening popup on autofill change - #3924

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:atomiks/autofill-tests
Feb 9, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:atomiks/autofill-tests

Conversation

@atomiks

@atomiks atomiks commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

@atomiks atomiks added type: bug It doesn't behave as expected. component: combobox Changes related to the combobox component. labels Feb 1, 2026
@atomiks
atomiks force-pushed the atomiks/autofill-tests branch from fb6d3b5 to 6e9f23e Compare February 1, 2026 23:26
@pkg-pr-new

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

commit: 903e8f0

@netlify

netlify Bot commented Feb 1, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit fb6d3b5
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/697fe1095a33fc0008a326ca
😎 Deploy Preview https://deploy-preview-3924--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.

@mui-bot

mui-bot commented Feb 1, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+282B(+0.07%) 🔺+135B(+0.10%)

Details of bundle changes


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

@netlify

netlify Bot commented Feb 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 903e8f0
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69897ed5935c04000808d340
😎 Deploy Preview https://deploy-preview-3924--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 force-pushed the atomiks/autofill-tests branch 3 times, most recently from 18215de to 2b5f3ce Compare February 2, 2026 00:40
@atomiks
atomiks marked this pull request as ready for review February 2, 2026 05:47
@atomiks
atomiks force-pushed the atomiks/autofill-tests branch from 2b5f3ce to 438f595 Compare February 2, 2026 05:49
@greptile-apps

greptile-apps Bot commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR prevents the combobox popup from opening when browser autofill changes the input value programmatically. The fix distinguishes between real user input (typing, pasting, composing) and programmatic changes by checking for the presence of InputEvent.inputType.

Key changes:

  • Added inputType check in ComboboxInput.tsx to gate popup opening logic (only opens when inputType is present)
  • Added matching inputType check in AriaCombobox.tsx to gate auto-highlight behavior
  • Included bugfix for chip navigation: only refocus input when navigating from a highlighted chip back to input
  • Added comprehensive test coverage for autofill and paste behaviors
  • Created experiment page demonstrating autofill with combobox and select components

Confidence Score: 5/5

  • Safe to merge - clean implementation with proper test coverage and no breaking changes
  • The implementation correctly distinguishes autofill from real user input using the standard InputEvent.inputType property, includes comprehensive test coverage, and contains a bonus bugfix for chip navigation logic
  • No files require special attention

Important Files Changed

Filename Overview
packages/react/src/combobox/input/ComboboxInput.tsx Added inputType check to prevent autofill from opening popup, only opens on real user input
packages/react/src/combobox/root/AriaCombobox.tsx Added inputType check to gate auto-highlight logic for autofill events
packages/react/src/combobox/root/ComboboxRoot.test.tsx Added tests verifying autofill doesn't open popup and paste events do open popup

@atomiks
atomiks force-pushed the atomiks/autofill-tests branch from ff5bb05 to 9721c8c Compare February 8, 2026 23:53
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@atomiks
atomiks force-pushed the atomiks/autofill-tests branch from 9721c8c to 7e59008 Compare February 9, 2026 04:43
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@atomiks
atomiks force-pushed the atomiks/autofill-tests branch 5 times, most recently from dc5b76b to 03baa3d Compare February 9, 2026 06:19
@atomiks
atomiks force-pushed the atomiks/autofill-tests branch from 03baa3d to 903e8f0 Compare February 9, 2026 06:29
@atomiks
atomiks merged commit 29ba00c into mui:master Feb 9, 2026
7 checks passed
@atomiks
atomiks deleted the atomiks/autofill-tests branch February 9, 2026 06:48
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.

3 participants