Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip on svg misplacement after scrolling the page #21855

Closed
pm-Egor-Genning opened this issue Jan 27, 2017 · 1 comment
Closed

Tooltip on svg misplacement after scrolling the page #21855

pm-Egor-Genning opened this issue Jan 27, 2017 · 1 comment
Labels

Comments

@pm-Egor-Genning
Copy link

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
@sjd78
Copy link

sjd78 commented Feb 13, 2017

This is the same as issue #20381 (Positioning error on SVG tooltips/popovers when scrolled, then clicked) that was caused by PR #20313 for issue #20280 (Unit test for tooltip on SVG element fails in Chrome+Safari under jQuery 3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants