From 1c01dc0ee9f21b118d7db9717c81d184de50c7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=A7=E8=A1=A1?= Date: Fri, 25 Aug 2017 20:10:07 +0800 Subject: [PATCH] fix(module:select): fix select reset bug in form close #128 --- src/components/select/nz-select.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/select/nz-select.component.ts b/src/components/select/nz-select.component.ts index efba53f2cb3..4c2fe453872 100644 --- a/src/components/select/nz-select.component.ts +++ b/src/components/select/nz-select.component.ts @@ -492,7 +492,11 @@ export class NzSelectComponent implements OnInit, AfterContentInit, AfterContent if (this._value === value) { return; } - this._value = value; + if ((value === null) && this.nzMultiple) { + this._value = []; + } else { + this._value = value; + } if (!this.nzMultiple) { if (value === null) { this._selectedOption = null; @@ -506,6 +510,8 @@ export class NzSelectComponent implements OnInit, AfterContentInit, AfterContent } else { this.updateSelectedOption(value, true); } + } else if (value === null) { + this.clearAllSelectedOption(); } }