Closed rcb98 closed 8 months ago
This should've been fixed in #28628, but it hasn't been released yet.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
MatAutocomplete's
requireSelection
directive has a weird behaviour that isn't present in the documentation examples but is present in the Stackblitz link attached to the same example titled "Require an autocomplete option to be selected".Reproduction
StackBlitz link: https://stackblitz.com/edit/vctmtb?file=src%2Fexample%2Fautocomplete-require-selection-example.css Steps to reproduce:
NOTE: It's possible that it works as expected on the first try, so in that case, try to follow the same steps another time but with another option.
Expected Behavior
The form control should be cleaned out when detecting the option is not the same as one of the autocomplete's options. In this case, "Onea" is not the same as "One", so the input should reset and left empty.
Here you can see it working as expected in Angular Material's MatAutocomplete documentation.
Actual Behavior
The input is not cleaned out and stays with the wrong value.
Environment