Dropdown: selectedItem template not displayed on the first change of form control #14283
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
If Dropdown has
selectedItem
template that uses the context variable and this dropdown is connected to reactive form there might be an issue when dynamically setting the value for the first time (for example inngOnInit
or inInput
setter callingcontrol.setValue
). Dropdown displayed shrunk and there's no value, but on click it returns to normal display. Seems like some rerender issue during change detection.Environment
Any environment
Reproducer
https://stackblitz.com/edit/qgxlcn?file=src%2Fapp%2Fdemo%2Fdropdown-template-demo.ts,src%2Fapp%2Fdemo%2Fdropdown-template-demo.html
Angular version
17.0.0
PrimeNG version
17.0.0-rc.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.18.0
Browser(s)
No response
Steps to reproduce the behavior
https://stackblitz.com/edit/qgxlcn?file=src%2Fapp%2Fdemo%2Fdropdown-template-demo.ts,src%2Fapp%2Fdemo%2Fdropdown-template-demo.html
selectedItem
template to Dropdown and use context variable to display the valuengOnInit
set some value to the controlExpected behavior
Dropdown should display value correctly
The text was updated successfully, but these errors were encountered: