Autocomplete: ngModel value changes to null before selecting when forceSelection is true #15880
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
When [forceSelection] is enabled on the autocomplete component, when selecting a value the model changes to null for a split second before changing to the selected value. This leads to some weird bugs if the DOM is updated depending upon the autocomplete value.
Environment
Stackblitz
Reproducer
https://stackblitz.com/edit/xckznk?file=src%2Fapp%2Fautocomplete-force-selection-demo.html,src%2Fapp%2Fautocomplete-force-selection-demo.ts,src%2Findex.html
Angular version
18.0.1
PrimeNG version
17.18.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v18.20.3
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The component should not set the model value to
null
before selecting a value when forceSelection is true.If I use OnSelect event, I don't get the null which is expected. when using ngModel or reactive forms the similar behaviour should be there.
The text was updated successfully, but these errors were encountered: