From 6d88983ac8d41092de38aab87d555819a814308f Mon Sep 17 00:00:00 2001 From: ossowski Date: Thu, 1 Jul 2021 11:12:44 +0200 Subject: [PATCH] fix(module:select): exact match while searching should be active --- 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 af84d1def4..00a1310514 100644 --- a/components/select/select.component.ts +++ b/components/select/select.component.ts @@ -319,7 +319,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) {