Skip to content

Commit 48d2a25

Browse files
konossowossowski
andauthored
fix(module:select): exact match while searching should be active (#6816)
Co-authored-by: ossowski <ossowski@pdtec.de> close #6812
1 parent b82d2f3 commit 48d2a25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/select/select.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,9 @@ export class NzSelectComponent implements ControlValueAccessor, OnInit, AfterCon
312312
}
313313
}
314314
const activatedItem =
315-
listOfContainerItem.find(item => this.compareWith(item.nzValue, this.listOfValue[0])) || listOfContainerItem[0];
315+
listOfContainerItem.find(item => item.nzLabel === this.searchValue) ||
316+
listOfContainerItem.find(item => this.compareWith(item.nzValue, this.listOfValue[0])) ||
317+
listOfContainerItem[0];
316318
this.activatedValue = (activatedItem && activatedItem.nzValue) || null;
317319
let listOfGroupLabel: Array<string | number | TemplateRef<NzSafeAny> | null> = [];
318320
if (this.isReactiveDriven) {

0 commit comments

Comments
 (0)