Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
fix(tooltip): set initial position of tooltip
Browse files Browse the repository at this point in the history
Set initial position of the tooltip so that its inclusion at the bottom
of the page does not cause the scroll bar to appear and offset the
calculation of the tooltip's final position.

Fixes #4345. Closes #5654.
  • Loading branch information
Joshua Lutes authored and ThomasBurleson committed Apr 19, 2016
1 parent c0793c8 commit 1cc80d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/tooltip/tooltip.js
Expand Up @@ -234,8 +234,9 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
}

function showTooltip() {
// Insert the element before positioning it, so we can get the position
// Insert the element and position at top left, so we can get the position
// and check if we should display it
element.css({top: 0, left: 0});
tooltipParent.append(element);

// Check if we should display it or not.
Expand Down

0 comments on commit 1cc80d3

Please sign in to comment.