Dropdown: Placeholder is not displayed when using a combination of reactive forms and selectedItem template
Describe the bug
Follow up on https://github.com/primefaces/primeng/issues/14695
When using a dropdown within a reactive form and while using the template for selectedItem, the placeholder is not shown.
Environment
Chrome on Mac OS
Reproducer
https://stackblitz.com/edit/github-lobmlu-qzceky?file=src%2Fapp%2Fapp.component.html
Angular version
17.1.3
PrimeNG version
17.6.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.9.0
Browser(s)
No response
Steps to reproduce the behavior
Check the Stackblitz
Expected behavior
Placeholders always show when no option is selected.
The follow change to line 29 of your reproducer fixes the issue:
Change:
name: ['']
To:
name: [null]
Thanks @rosenthalj, this solves it for me. But I still think there is a little issue here as in the case "Reactive forms an no seletedItem template" the placeholder is shown, even though it uses the same control. I would expect the same placeholder behaviour for the case with template and without.