From 48d2a2538c9ddef5f77804cbecbf4c157f4e9f22 Mon Sep 17 00:00:00 2001 From: Konrad Ossowski Date: Thu, 3 Mar 2022 04:57:31 +0100 Subject: [PATCH] fix(module:select): exact match while searching should be active (#6816) Co-authored-by: ossowski close #6812 --- components/select/select.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/select/select.component.ts b/components/select/select.component.ts index 83f59d7938..4540409ee7 100644 --- a/components/select/select.component.ts +++ b/components/select/select.component.ts @@ -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 | null> = []; if (this.isReactiveDriven) {