Skip to content

[Autocomplete] fix unintended focus in autocomplete#47808

Open
atharva3333 wants to merge 2 commits intomui:masterfrom
atharva3333:autocomplete-unintended-focus
Open

[Autocomplete] fix unintended focus in autocomplete#47808
atharva3333 wants to merge 2 commits intomui:masterfrom
atharva3333:autocomplete-unintended-focus

Conversation

@atharva3333
Copy link
Contributor

Fixes - #47661

This issue occurs when the popup of one Autocomplete overlaps another Autocomplete.

Reproduction Steps

  1. Focus an Autocomplete to open its popup.
  2. Click outside the browser window (without minimizing it).
  3. Click and hold the mouse button on the border of another overlapping Autocomplete.

Observed Behavior

During the mousedown phase (before mouseup):

  • The previously focused Autocomplete regains focus.
  • For a normal Autocomplete, this causes an unintended label shrink.
  • For openOnFocus, the popup opens (since its getting focused) during the mouse hold and select an option on mouse release.

This behavior appears to be triggered by the following logic inside handleMouseDown:

if (event.target.getAttribute('id') !== id) {
  event.preventDefault();
}

@mui-bot
Copy link

mui-bot commented Feb 18, 2026

Netlify deploy preview

https://deploy-preview-47808--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+202B(+0.04%) 🔺+31B(+0.02%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 5e500ae

@zannager zannager added the scope: autocomplete Changes related to the autocomplete. This includes ComboBox. label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: autocomplete Changes related to the autocomplete. This includes ComboBox.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments