I am using p-dropdown
in my app and have noticed that after upgrading to PrimeNG 9 & Angular 10, the p-dropdown
is no longer taking the custom value as the default value. Instead it takes the first value present in the options list as the default value. Further more the label now only fills half of the drop down while the reset is just empty. How can I fix this? Thanks in advance.
here is my template:
<div fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="10px">
<p-dropdown [options]="cityList" tooltipPosition="left" [(ngModel)]="selectedCity" optionLabel="label"></p-dropdown>
<p-dropdown [options]="carList" tooltipPosition="left" [(ngModel)]="selectedCar" optionLabel="label"></p-dropdown>
</p-button>
</div>
here is my ts code:
this.carList = [{ label: 'BMW', value: 'BMW' },{ label: 'Tesla', value: 'Tesla' },{ label: 'Toyota', value: 'Toyota' }];
this.cityList = [{ label: 'New York', value: 'New York' },{ label: 'Chicago', value: 'Chicago' },{ label: 'Boston', value: 'Boston' }];
this.selectedCity = { label: 'None', value: 'None' };
this.selectedCar = { label: 'None', value: 'None' };