Skip to content

Commit 11786d2

Browse files
alurmarijnh
authored andcommitted
[hint addon] Handle scrolling containers
1 parent 5294bf1 commit 11786d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addon/hint/show-hint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@
239239
var offsetParent = isContainerPositioned ? container : container.offsetParent;
240240
var offsetParentPosition = offsetParent.getBoundingClientRect();
241241
var bodyPosition = ownerDocument.body.getBoundingClientRect();
242-
offsetLeft = (offsetParentPosition.left - bodyPosition.left);
243-
offsetTop = (offsetParentPosition.top - bodyPosition.top);
242+
offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);
243+
offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);
244244
}
245245
hints.style.left = (left - offsetLeft) + "px";
246246
hints.style.top = (top - offsetTop) + "px";

0 commit comments

Comments
 (0)