diff --git a/src/dropdown/bs-dropdown.directive.ts b/src/dropdown/bs-dropdown.directive.ts index 8ddff67dda..01a9f089db 100644 --- a/src/dropdown/bs-dropdown.directive.ts +++ b/src/dropdown/bs-dropdown.directive.ts @@ -116,6 +116,9 @@ export class BsDropdownDirective implements OnInit, OnDestroy { this.onShown = this._dropdown.onShown; this.onHidden = this._dropdown.onHidden; + + // set initial dropdown state from config + this._state.autoClose = this._config.autoClose; } ngOnInit(): void { @@ -127,9 +130,6 @@ export class BsDropdownDirective implements OnInit, OnDestroy { show: () => this.show() }); - // set initial dropdown state from config - this._state.autoClose = this._config.autoClose; - // toggle visibility on toggle element click this._subscriptions.push(this._state .toggleClick.subscribe((value: boolean) => this.toggle(value)));