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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user