p-dropdown: option displays "empty" when value is 0 (zero) instead of the actual value 0 #12455
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When using an array of numbers for the dropdown options and that one of the values is 0 then the corresponding option displays "empty" instead of the actual value 0.
This is because the template at line 60 uses a
||
instead of??
.Environment
N/A
Reproducer
https://stackblitz.com/edit/github-fkqm3v?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts
Angular version
15.0.4
PrimeNG version
15.0.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.12.1
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The option shouldn't display "empty" when the value is neither
null
norundefined
.Use the optional operator
??
instead of the boolean operator||
in the template.The text was updated successfully, but these errors were encountered: