Open fredpeaks opened 3 months ago
@fredpeaks can you please create a reproducer in stackblitz?
Hello,
I have a similar problem.
To reproduce, replace
this.formGroup = new FormGroup({ selectedCountry: new FormControl<object | null>(null) });
with
this.formGroup = new FormGroup({ selectedCountry: new FormControl<object | null>({ "name": null, "code": null }) });
in the src\app\showcase\doc\autocomplete\reactiveformsdoc.ts file
Describe the bug
The problem is at this line of code : https://github.com/primefaces/primeng/blob/e142de683b9cbcf2342774e9390ee09b0934580f/src/app/components/autocomplete/autocomplete.ts#L787C17-L787C59
It should not return the full object when the computed label is null or undefined.
Environment
not relevant
Reproducer
No response
Angular version
18
PrimeNG version
17.18.4
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
latest
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response