Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete] Fix when onHighlightChange is called #45438

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Feb 28, 2025

Fixes #43213

The onHighlightChange prop, introduced in #20691, did not correctly determine when it should be triggered.

This PR:

Notice that the event parameter was undefined, further indicating incorrect handling.

I have also modified the test cases.

Before: https://stackblitz.com/edit/react-d4b5ls?file=Demo.tsx
After: https://codesandbox.io/p/sandbox/material-ui-cra-ts-forked-mpm2ft

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material component: autocomplete This is the name of the generic UI component, not the React module! labels Feb 28, 2025
@mui-bot
Copy link

mui-bot commented Feb 28, 2025

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against d631a95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui][Autocomplete] onHighlightChange called when listbox opens without any option being highlighted
2 participants