primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Dropdown: Default value is not displayed if no placeholder is provided

Open gpobr opened this issue 1 year ago • 3 comments

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

  1. Create a dropdown wrapper that acts as a FormControl, name it <dropdown>
  2. Dropdown wrapper defines a p-dropdown component
  3. Define the dropdown wrapper once with options and ngModel and once with options, ngModel and placeholder
  4. 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.

gpobr avatar Mar 08 '24 16:03 gpobr

Tried to replicate this issue but appears fixed in latest version of primeNG 17.14.1

RogueTea avatar Apr 25 '24 13:04 RogueTea

Same issue here with async optiosn: https://github.com/primefaces/primeng/issues/14190#issuecomment-2221402942

digitalcraftco avatar Jul 10 '24 20:07 digitalcraftco