Skip to content

Commit

Permalink
fix(dropdown): fix dropup bs3 position (#3863)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSurmay authored and valorkin committed Feb 22, 2018
1 parent 86a13a0 commit 2a177aa
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/dropdown/bs-dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export class BsDropdownDirective implements OnInit, OnDestroy {

if (this._showInline) {
this.removeShowClass();
this.removeDropupStyles();
this._isInlineOpen = false;
this.onHidden.emit(true);
} else {
Expand Down Expand Up @@ -281,7 +282,7 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
if (!isBs3()) {
this.addShowClass();
this.checkRightAlignment();
this.checkDropup();
this.addDropupStyles();
}
}

Expand Down Expand Up @@ -315,7 +316,7 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
}
}

private checkDropup(): void {
private addDropupStyles(): void {
if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) {
// a little hack to not break support of bootstrap 4 beta
this._renderer.setStyle(
Expand All @@ -330,4 +331,11 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
);
}
}

private removeDropupStyles(): void {
if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) {
this._renderer.removeStyle(this._inlinedMenu.rootNodes[0], 'top');
this._renderer.removeStyle(this._inlinedMenu.rootNodes[0], 'transform');
}
}
}

0 comments on commit 2a177aa

Please sign in to comment.