mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-19 09:50:33 +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:
@@ -2,11 +2,12 @@ export default {
|
|||||||
inserted (el, bindings, {context}) {
|
inserted (el, bindings, {context}) {
|
||||||
if (context.appendToBody) {
|
if (context.appendToBody) {
|
||||||
const {height, top, left, width} = context.$refs.toggle.getBoundingClientRect();
|
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, {
|
el.unbindPosition = context.calculatePosition(el, context, {
|
||||||
width: width + 'px',
|
width: width + 'px',
|
||||||
top: (window.scrollY + top + height) + 'px',
|
top: (scrollX + top + height) + 'px',
|
||||||
left: (window.scrollX + left) + 'px',
|
left: (scrollY + left) + 'px',
|
||||||
});
|
});
|
||||||
|
|
||||||
document.body.appendChild(el);
|
document.body.appendChild(el);
|
||||||
|
|||||||
Reference in New Issue
Block a user