Skip to content

Commit

Permalink
fix(IE11): make appendToBody directive IE11 friendly
Browse files Browse the repository at this point in the history
add a check for the IE implementation of scroll window variables so that the appendToBody Directive is compatible with IE 11
  • Loading branch information
bertybot authored Jun 25, 2020
1 parent b7c5119 commit bfad3d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/directives/appendToBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ export default {
inserted (el, bindings, {context}) {
if (context.appendToBody) {
const {height, top, left, width} = context.$refs.toggle.getBoundingClientRect();

let scrollX = window.scrollX || window.pageXOffset;
let scrollY = window.scrollY || window.pageYOffset;
el.unbindPosition = context.calculatePosition(el, context, {
width: width + 'px',
top: (window.scrollY + top + height) + 'px',
left: (window.scrollX + left) + 'px',
top: (scrollX + top + height) + 'px',

This comment has been minimized.

Copy link
@aureolebigben

aureolebigben Jul 2, 2020

Contributor

scrollX and scrollY are inverted

left: (scrollY + left) + 'px',

This comment has been minimized.

Copy link
@aureolebigben

aureolebigben Jul 2, 2020

Contributor

scrollX and scrollY are inverted

});

document.body.appendChild(el);
Expand Down

0 comments on commit bfad3d0

Please sign in to comment.