Describe the bug
There is a problem using the autocomplete component and the properties optionLabel and optionValue. If the compoment has a preselected value, check the example for selectedCountry this one is displayed in the input without checking in the provided suggestions and usign the optionLabel provided.
In the demo provided you can see that for the pre selected value CA should display in the input Canada but instead if display CA
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/xudvtudh?file=src%2Fapp%2Fautocomplete-objects-demo.ts
Environment
Quite normal env, Mac, Chrome, I don't think this is relevant for this issue.
Angular version
20
PrimeNG version
v20
Node version
22.19.0
Browser(s)
Chrome but I think this isn't browser dependant
Steps to reproduce the behavior
There is no need for steps, this happens on first load of the autocomplete component, it doesn't use the optionLabel and display the value.
Expected behavior
When selectedCountry is initialized with a value it should display the suggestion label if avaialble respeting the optionLabel property. This means if selectedCountry is pre filled with CA and the optionLabel is provided and there is an entry in the suggestions that match this criteria the input should display Canada and not CA.
Describe the bug
There is a problem using the autocomplete component and the properties
optionLabelandoptionValue. If the compoment has a preselected value, check the example forselectedCountrythis one is displayed in the input without checking in the provided suggestions and usign theoptionLabelprovided.In the demo provided you can see that for the pre selected value
CAshould display in the inputCanadabut instead if displayCAPull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/xudvtudh?file=src%2Fapp%2Fautocomplete-objects-demo.ts
Environment
Quite normal env, Mac, Chrome, I don't think this is relevant for this issue.
Angular version
20
PrimeNG version
v20
Node version
22.19.0
Browser(s)
Chrome but I think this isn't browser dependant
Steps to reproduce the behavior
There is no need for steps, this happens on first load of the autocomplete component, it doesn't use the
optionLabeland display the value.Expected behavior
When
selectedCountryis initialized with a value it should display the suggestion label if avaialble respeting theoptionLabelproperty. This means ifselectedCountryis pre filled withCAand theoptionLabelis provided and there is an entry in the suggestions that match this criteria the input should displayCanadaand notCA.