Dropdown: Default value is not displayed if no placeholder is provided
Describe the bug
Wrapped PrimeNG dropdown does not display the default value if no placeholder value is provided. If the placeholder value is provided, then the default dropdown value is displayed. This is observed in dropdowns that define options of type number[] and value of type number.
Environment
Windows
Reproducer
https://stackblitz.com/edit/sblsab?file=src%2Fapp%2Fdemo%2Fdropdown-basic-demo.ts
Angular version
17.2
PrimeNG version
17.10
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.9
Browser(s)
No response
Steps to reproduce the behavior
- Create a dropdown wrapper that acts as a FormControl, name it
<dropdown> - Dropdown wrapper defines a p-dropdown component
- Define the dropdown wrapper once with options and ngModel and once with options, ngModel and placeholder
- Notice that the dropdown that does not provide a placeholder value, will not display the default value
Please use the provided reproducer as a reference
Expected behavior
Dropdown should display the default value.
Tried to replicate this issue but appears fixed in latest version of primeNG 17.14.1
Same issue here with async optiosn: https://github.com/primefaces/primeng/issues/14190#issuecomment-2221402942