Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Autocomplete doesn't work as expected when working with Objects if the Object contains key named value #17469

Description

@wildbsiu

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 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.

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

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

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

  1. Head to the StackBlitz example and run the same.
  2. Select any item from the autocomplete.
  3. 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'}
  4. Now, simply go the file countryservice.ts and rename key value to something else like code. Save and run.
  5. Selected item now shows full object.

Expected behavior

Selected item should contain all object keys

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions