AutoComplete does not display 0 as value #9628
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ...
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/primeng-autocomplete-demo-yvyemq
Current behavior
When using AutoComplete with objects and a numeric value then objects with value 0 are not displayed.
This is because 0 is a falsy value and therefore it is ignored in the first line of
updateInputField()
.I solved this by replacing
||
with??
.Expected behavior
When selecting an object with value 0 (e.g.
{ name: 'test', value: 0}
) then 0 should be displayed.Angular version: 11
PrimeNG version: 11
The text was updated successfully, but these errors were encountered: