Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 1cc80d3

Browse files
Joshua LutesThomasBurleson
authored andcommitted
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. Closes #5654.
1 parent c0793c8 commit 1cc80d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/tooltip/tooltip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
234234
}
235235

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

241242
// Check if we should display it or not.

0 commit comments

Comments
 (0)