Dropdown Component showing empty when the value equals to a zero

Hi
When using an array as the source of data for a dropdown component,
for example:

[{text:0},{text:100}]

It saves correctly on the form submission, the value is sent as an integer, thats fine.

The issue comes when loading the form, if the value was a zero, the dropdown shows it as empty as shown below:

image

image

1 Like

Hi @Jose_Carrillo,

This seems to be an implementation detail of the PrimeNG dropdown. It renders empty when the label is "falsy" (which is true for 0). The solution is to always use a string property for the dropdown: [{text:"0"},{text:"100"}]

1 Like