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

Commit f62f693

Browse files
kasiarachwalThomasBurleson
authored andcommitted
fix(tooltip): corrected md-tooltip positioning when scrolled
There are several issues out there (e.g. #2406) that point to tooltip positioning when the page is scrolled and getNearestContentElement that suggests that the enclosed loop is supposed to stop at md-content but does not. Adding that condition to the loop fixed the positioning issue for me. Fixes #2406. Closes #5161.
1 parent c9f822d commit f62f693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/tooltip/tooltip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
118118
function getNearestContentElement () {
119119
var current = element.parent()[0];
120120
// Look for the nearest parent md-content, stopping at the rootElement.
121-
while (current && current !== $rootElement[0] && current !== document.body) {
121+
while (current && current !== $rootElement[0] && current !== document.body && current.nodeName !== 'MD-CONTENT') {
122122
current = current.parentNode;
123123
}
124124
return current;

0 commit comments

Comments
 (0)