From 0bd1ae3569a215ba218bc17984b18cbf34357eae Mon Sep 17 00:00:00 2001 From: vthinkxie Date: Tue, 25 Jun 2019 11:35:09 +0800 Subject: [PATCH] fix(module:dropdown): dropdown should close when set disabled close #3420 --- components/dropdown/nz-dropdown.directive.ts | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/dropdown/nz-dropdown.directive.ts b/components/dropdown/nz-dropdown.directive.ts index 97d8176530..b4163911f1 100644 --- a/components/dropdown/nz-dropdown.directive.ts +++ b/components/dropdown/nz-dropdown.directive.ts @@ -72,6 +72,11 @@ export class NzDropDownDirective implements AfterViewInit, OnDestroy, OnChanges setDisabled(disabled: boolean): void { if (disabled) { this.renderer.setAttribute(this.el, 'disabled', ''); + if (this.nzVisible) { + this.nzVisible = false; + this.nzVisibleChange.emit(this.nzVisible); + this.updateOverlayByVisible(); + } } else { this.renderer.removeAttribute(this.el, 'disabled'); } diff --git a/package.json b/package.json index a53e8c7297..8088a294ff 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "date-fns": "^1.29.0" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.800.1", + "@angular-devkit/build-angular": "0.800.3", "@angular-devkit/build-ng-packagr": "~0.800.1", "@angular-devkit/core": "~8.0.1", "@angular-devkit/schematics": "~8.0.1",