Skip to content

Commit

Permalink
fix(module:select): exact match while searching should be active
Browse files Browse the repository at this point in the history
  • Loading branch information
ossowski committed Jul 1, 2021
1 parent ca2d3eb commit 6d88983
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/select/select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | number | TemplateRef<NzSafeAny> | null> = [];
if (this.isReactiveDriven) {
Expand Down

0 comments on commit 6d88983

Please sign in to comment.