From dd3ccded4d4c0a2d5cd4e0238372892ea6fb008b Mon Sep 17 00:00:00 2001 From: Joshua Lutes Date: Tue, 10 Nov 2015 13:23:54 -0800 Subject: [PATCH] fix(tooltip): set initial position of tooltip 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 --- src/components/tooltip/tooltip.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/tooltip/tooltip.js b/src/components/tooltip/tooltip.js index bc50ad7132..d85281ce0d 100644 --- a/src/components/tooltip/tooltip.js +++ b/src/components/tooltip/tooltip.js @@ -175,8 +175,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.