Skip to content

Commit

Permalink
fix(module:select): exact match while searching should be active (#6816)
Browse files Browse the repository at this point in the history
Co-authored-by: ossowski <ossowski@pdtec.de>
close #6812
  • Loading branch information
konossow committed Mar 3, 2022
1 parent b82d2f3 commit 48d2a25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/select/select.component.ts
Expand Up @@ -312,7 +312,9 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
}
}
const activatedItem =
listOfContainerItem.find(item => this.compareWith(item.nzValue, this.listOfValue[0])) || listOfContainerItem[0];
listOfContainerItem.find(item => item.nzLabel === this.searchValue) ||
listOfContainerItem.find(item => this.compareWith(item.nzValue, this.listOfValue[0])) ||
listOfContainerItem[0];
this.activatedValue = (activatedItem && activatedItem.nzValue) || null;
let listOfGroupLabel: Array<string | number | TemplateRef<NzSafeAny> | null> = [];
if (this.isReactiveDriven) {
Expand Down

0 comments on commit 48d2a25

Please sign in to comment.