We are using the Angular AutoComplete component with the forceSelection property set to true. The component is inside a form and includes a required validator. When the user starts typing, suggestions appear. The issue specifically arises when the user clicks on a suggestion in the dropdown. At this point, the forceSelection property first clears the value (since focus is on the dropdown), then a validation message appears due to the field being required, and finally, the selected value appears. This behavior is quite annoying as it causes a momentary UI blink.
Do you have any suggestions for a temporary fix?
Regards,
Nejc
Environment
Windows 11 Enterprise (22H2), Angular 16.2.3, PrimeNG 16.2.0
Reproducer
No response
Angular version
16.2.3
PrimeNG version
16.2.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
0.0.0.
Browser(s)
Firefox 117.0
Steps to reproduce the behavior
No response
Expected behavior
Force selection is not triggered if the autocomplete input control loses focus, but the dropdown is still in focus.
Describe the bug
Hi,
We are using the Angular AutoComplete component with the forceSelection property set to true. The component is inside a form and includes a required validator. When the user starts typing, suggestions appear. The issue specifically arises when the user clicks on a suggestion in the dropdown. At this point, the forceSelection property first clears the value (since focus is on the dropdown), then a validation message appears due to the field being required, and finally, the selected value appears. This behavior is quite annoying as it causes a momentary UI blink.
Do you have any suggestions for a temporary fix?
Regards, Nejc
Environment
Windows 11 Enterprise (22H2), Angular 16.2.3, PrimeNG 16.2.0
Reproducer
No response
Angular version
16.2.3
PrimeNG version
16.2.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
0.0.0.
Browser(s)
Firefox 117.0
Steps to reproduce the behavior
No response
Expected behavior
Force selection is not triggered if the autocomplete input control loses focus, but the dropdown is still in focus.