-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Select doesn't lose focus if element is deleted from inside its input. #18465
Comments
Why should it behave this way? |
Having a closer look, I don't think that the element should lose focus by default. You can blur the element if it better suite your use case. |
@oliviertassinari Thanks for your quick answer. I am sorry, but you are able to make the Select lose focus at all? For me it stays focused - if there is a second input, it will get focused but Select remains colored as if focus is within it. I have edited the sandbox and steps to repro. |
@maximovicd Thanks for the updated codesandbox. It's better, we can clearly see the problem. I fear we can't do anything about it. You can work around the issue by focusing the select input back when you delete a tag. But in any case, it's not supported. You might prefer the autocomplete component for this use case. |
Actually, deletable chips are likely to be "impossible" to make work once we move #17978 forward. |
Thanks a lot, refocusing after delete works good as a workaround! |
@maximovicd I would advise finding another way, it's not supported. Your workaround won't be working in the next release after #17978, you will have to further customize the integration (control the open prop and delay the interaction). |
This is still an issue in the latest version. |
Current Behavior 😯
If there is a Chip with a delete button displayed in the Input of Select component. When the delete button is clicked, the Select remains focused.
Expected Behavior 🤔
Select should lose focus or lose it after clicking outside of it again.
Steps to Reproduce 🕹
https://codesandbox.io/s/gracious-morning-ow6nn - edited
Steps:
Context 🔦
Think this is a fairly common use case.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: