From 37f45a37c5a801f9c5bcf7f48778a71b99da7df2 Mon Sep 17 00:00:00 2001 From: lucaQ Date: Wed, 10 Jan 2024 16:47:51 +0100 Subject: [PATCH] AutoComplete: Unique option doesn't work Fixes #14505 --- src/app/components/autocomplete/autocomplete.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 02ba2686edb..9a0585ab95d 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -1010,6 +1010,9 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr } isSelected(option) { + if (this.multiple) { + return this.unique ? this.modelValue()?.find((model) => ObjectUtils.equals(model, this.getOptionValue(option), this.equalityKey())) : false; + } return ObjectUtils.equals(this.modelValue(), this.getOptionValue(option), this.equalityKey()); }