You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Autocomplete doesn't behave as expected when working with objects and object has a key called value. When selecting an item from Autocomplete suggestion, expected selected item is supposed to be an object containing all the keys in the object. But selected item contains only value key.
However, if I simply rename value key to something else, say code, then behavior is as expected. Selected item in this contains all keys from the object.
Selected item json shows only the value key. e.g if you select United States, the selected item is shown as US instead of expected {name: 'United States', value: 'US'}
Now, simply go the file countryservice.ts and rename key value to something else like code. Save and run.
Describe the bug
Autocomplete doesn't behave as expected when working with objects and object has a key called
value. When selecting an item from Autocomplete suggestion, expected selected item is supposed to be an object containing all the keys in the object. But selected item contains onlyvaluekey.However, if I simply rename
valuekey to something else, saycode, then behavior is as expected. Selected item in this contains all keys from the object.Based on the example for Autocomplete when working with objects - https://primeng.org/autocomplete#objects, I have forked the StackBlitz example to showcase the issue at: https://stackblitz.com/edit/7pl9oavs-6kg2ha5d
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/7pl9oavs-6kg2ha5d
Environment
Windows 11
Angular version
19.0.1
PrimeNG version
v19
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
valuekey. e.g if you selectUnited States, the selected item is shown asUSinstead of expected{name: 'United States', value: 'US'}countryservice.tsand rename keyvalueto something else likecode. Save and run.Expected behavior
Selected item should contain all object keys