2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

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
This commit is contained in:
bertybot
2020-06-25 13:45:01 -04:00
committed by GitHub
parent b7c5119a2d
commit bfad3d00c6
+4 -3
View File
@@ -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);