-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 stops showing the List when clicking in the input field after adding a Mat-Chip #17292
Comments
As an ugly fix, you can disable and enable the Control at the end of the "selected" method: However I bet this will expose some counterbacks with advanced user navigation probably. |
I'm guessing it's because the list only shows up on focus and focus technically hasn't left the input. There's a PR to make it also open on clicks #16020. |
Yup. That's my guess too "(...) the user needs to focus out and then click to set the Focus in, in order to have the List shown." |
It might be simpler to call |
This worked for me, good idea :) |
how it make? |
const chipElement = document.querySelector('#chip-list');
chipElement.blur();
setTimeout(() => { chipElement.focus() }, 1); help resolve the problem for me. |
For anyone still needing this...
Hope this helps took a while to get it working smoothly today Edit: Heres a snippet of the template...
|
This was a clear solution to the chip list autocomplete not working properly after selection. Even the current documentation has this bug. |
@Koniouchine .. glad I could help. |
I made this little directive to "fix" this issue https://gist.github.com/128keaton/a67c3fe14d70dd3becd4628f56b18e34 |
Worked like a charm! Perfect solution. Thank you! |
Reproduction
Use StackBlitz to reproduce your issue:
Official Demo shows this issue.
https://run.stackblitz.com/api/angular/v1?file=app%2Fchips-autocomplete-example.ts
This example starts showing a Lemon in the autocomplete component.
Steps to reproduce:
Expected Behavior
What behavior were you expecting to see?
Users expect that clicking in the Input field would show them the List of options again, as it did in the very beginning without needing to use the "hackish" click out-and-in.
Actual Behavior
What behavior did you actually see?
If a Mat-chip is added, the user needs to focus out and then click to set the Focus in, in order to have the List shown.
Environment
The text was updated successfully, but these errors were encountered: