Skip to content

Commit

Permalink
AutoComplete: Unique option doesn't work
Browse files Browse the repository at this point in the history
Fixes #14505
  • Loading branch information
HeavyRainLQ committed Jan 10, 2024
1 parent c0ebcce commit 37f45a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 37f45a3

Please sign in to comment.