Tooltip on svg misplacement after scrolling the page
Created by: pm-Egor-Genning
Issue happens because: The Element.getBoundingClientRect() method returns the size of an element and its position relative to the viewport.
Need to extend tooltip position with:
Tooltip.prototype.getPosition = function ($element) {
$element = $element || this.$element
var el = $element[0]
var isBody = el.tagName == 'BODY'
var elRect = el.getBoundingClientRect();
elRect = $.extend({}, elRect, {
top: elRect.top + window.pageYOffset,
left: elRect.left + window.pageXOffset
});
... e.t.c