Skip to content

Commit

Permalink
fix(module:dropdown): dropdown should close when set disabled
Browse files Browse the repository at this point in the history
close #3420
  • Loading branch information
vthinkxie authored and vthinkxie committed Jun 25, 2019
1 parent 16d5c2d commit 0bd1ae3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions components/dropdown/nz-dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0bd1ae3

Please sign in to comment.