Skip to content

Conversation

@ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Sep 9, 2025

Fixes #46734

Also addresses another related issue which I thought was incorrectly reported: #46758.

This regression was introduced in #46489. When options was empty with freeSolo + autoHighlight, the highlighted index was not reset from 0 (index when using autoHighlight) back to -1. This caused blur/enter flows to misbehave (or crash in the multiple case).

The fix ensures that syncHighlightedIndex also runs when the popup opens, so the highlighted option state is properly reset initially even when no options are available.

Before: https://stackblitz.com/edit/zl8qpkqz-l48k1zpb
After: https://stackblitz.com/edit/zl8qpkqz-4xa6zupy

@ZeeshanTamboli ZeeshanTamboli added scope: autocomplete Changes related to the autocomplete. This includes ComboBox. type: regression A bug, but worse, it used to behave as expected. labels Sep 9, 2025
@mui-bot
Copy link

mui-bot commented Sep 9, 2025

Netlify deploy preview

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

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+9B(0.00%) 🔺+12B(+0.01%)
@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 f79bf99

@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review September 12, 2025 07:02
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Nice fix.

@ZeeshanTamboli ZeeshanTamboli merged commit 310a76e into mui:master Sep 15, 2025
18 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the issue-46734-autohighlight-freeSolo-prop branch September 15, 2025 14:54
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. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Autocomplete] Regression with 7.3 and Playwright

3 participants