From 1c4d7d816a572b1c690fe86e218e9565b95c605e Mon Sep 17 00:00:00 2001 From: diye <35769340+diyews@users.noreply.github.com> Date: Wed, 13 May 2020 20:22:31 +0800 Subject: [PATCH] fix(module:select): option item not selected with falsy value (#5264) --- components/select/option-item.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/select/option-item.component.ts b/components/select/option-item.component.ts index 2de3bfd5d51..99d125ffe1c 100644 --- a/components/select/option-item.component.ts +++ b/components/select/option-item.component.ts @@ -71,7 +71,7 @@ export class NzOptionItemComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): void { const { value, activatedValue, listOfSelectedValue } = changes; if (value || listOfSelectedValue) { - this.selected = this.listOfSelectedValue.find(v => this.compareWith(v, this.value)); + this.selected = this.listOfSelectedValue.some(v => this.compareWith(v, this.value)); } if (value || activatedValue) { this.activated = this.compareWith(this.activatedValue, this.value);