Skip to content

Commit

Permalink
fix: interactive tooltip position on ie11 (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase authored Feb 27, 2020
1 parent 5f2faef commit 3551531
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export default {
if (this.open) {
const menuPosition = this.$el.getBoundingClientRect();
return this.$nextTick(() => {
let pixelsScrolledX = window.scrollX || window.pageXOffset;
let pixelsScrolledY = window.scrollY || window.pageYOffset;
const pixelsScrolledX = window.scrollX || window.pageXOffset;
const pixelsScrolledY = window.scrollY || window.pageYOffset;
if (this.flipMenu) {
this.left =
menuPosition.left +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,30 @@ export default {
},
position() {
const menuPosition = this.$refs.trigger.getBoundingClientRect();
const pixelsScrolledX = window.scrollX || window.pageXOffset;
const pixelsScrolledY = window.scrollY || window.pageYOffset;
if (this.direction === 'top' || this.direction === 'bottom') {
this.left =
menuPosition.left +
0.5 +
(this.$refs.trigger.offsetWidth - this.$refs.popup.offsetWidth) / 2 +
window.scrollX;
pixelsScrolledX;
if (this.direction === 'bottom') {
this.top = menuPosition.bottom + 10 + window.scrollY;
this.top = menuPosition.bottom + 10 + pixelsScrolledY;
} else {
this.top = menuPosition.top - 15 - this.$refs.popup.offsetHeight + window.scrollY;
this.top = menuPosition.top - 15 - this.$refs.popup.offsetHeight + pixelsScrolledY;
}
} else {
this.top =
menuPosition.top +
(this.$refs.trigger.offsetHeight - 0.5 - this.$refs.popup.offsetHeight) / 2 +
window.scrollY;
pixelsScrolledY;
if (this.direction === 'left') {
this.left = menuPosition.left - 10 - this.$refs.popup.offsetWidth + window.scrollX;
this.left = menuPosition.left - 10 - this.$refs.popup.offsetWidth + pixelsScrolledX;
} else {
this.left = menuPosition.right + 15 + window.scrollX;
this.left = menuPosition.right + 15 + pixelsScrolledX;
}
}
},
Expand Down

0 comments on commit 3551531

Please sign in to comment.