Skip to content

Commit

Permalink
fix(dropdown): bootstrap 4 dropup fix in IE11 (#3057)
Browse files Browse the repository at this point in the history
The inline style on the element is top: auto, this fix is for cross browser support.

Fixes #3054
  • Loading branch information
brgaulin authored and valorkin committed Nov 23, 2017
1 parent a1ae01e commit 632abe1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/dropdown/bs-dropdown.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
private checkDropup(): void {
if (this._inlinedMenu && this._inlinedMenu.rootNodes[0]) {
// a little hack to not break support of bootstrap 4 beta
const top = getComputedStyle(this._inlinedMenu.rootNodes[0]).top;
const topAuto = top === 'auto' || top === '100%';
this._renderer.setStyle(
this._inlinedMenu.rootNodes[0],
'top',
Expand All @@ -328,7 +326,7 @@ export class BsDropdownDirective implements OnInit, OnDestroy {
this._renderer.setStyle(
this._inlinedMenu.rootNodes[0],
'transform',
this.dropup && !topAuto ? 'translateY(-101%)' : 'translateY(0)'
this.dropup ? 'translateY(-101%)' : 'translateY(0)'
);
}
}
Expand Down

0 comments on commit 632abe1

Please sign in to comment.