From bfad3d00c60bd1e5eff4f6d48ed54e20a5405d45 Mon Sep 17 00:00:00 2001 From: bertybot <44912991+bertybot@users.noreply.github.com> Date: Thu, 25 Jun 2020 13:45:01 -0400 Subject: [PATCH] fix(IE11): make appendToBody directive IE11 friendly add a check for the IE implementation of scroll window variables so that the appendToBody Directive is compatible with IE 11 --- src/directives/appendToBody.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/directives/appendToBody.js b/src/directives/appendToBody.js index 40cac0628..8867e99e5 100644 --- a/src/directives/appendToBody.js +++ b/src/directives/appendToBody.js @@ -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', + left: (scrollY + left) + 'px', }); document.body.appendChild(el);