mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
91.86k stars 31.57k forks source link

[material-ui][Select] Remove focus from the input when the listbox disappears #42091

Open vadaviya638 opened 2 weeks ago

vadaviya638 commented 2 weeks ago

Steps to reproduce

Link to live example: https://stackblitz.com/edit/vitejs-vite-kzseur?file=src%2FApp.tsx

Current behavior

Make a simple multiple select using Material UI's Select component. But one thing that I did not like is that if you unselect anything or just don't select anything and click outside, the dropdown disappears but the label remains focused until you click again or focus on other component.

Screenshot from 2024-05-02 10-23-20

Link to component: https://material-ui.com/demos/selects/

Original title for ease of reading:

Make a simple multiple select using Material UI's Select component. But one thing that I did not like is that if you unselect anything or just don't select anything and click outside, the dropdown disappears but the label remains focused until you click again or focus on other component.

Expected behavior

dropdown disappears then label focus also remove

Search keywords: select, dropdown , menu