diff --git a/src/position/position.js b/src/position/position.js index bfda14711b..727a85e85d 100644 --- a/src/position/position.js +++ b/src/position/position.js @@ -57,8 +57,8 @@ angular.module('ui.bootstrap.position', []) var offsetParentEl = parentOffsetEl(element[0]); if (offsetParentEl != $document[0]) { offsetParentBCR = this.offset(angular.element(offsetParentEl)); - offsetParentBCR.top += offsetParentEl.clientTop; - offsetParentBCR.left += offsetParentEl.clientLeft; + offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop; + offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft; } return { diff --git a/src/position/test/test.html b/src/position/test/test.html index 5076e9b30c..0ea75acc6a 100644 --- a/src/position/test/test.html +++ b/src/position/test/test.html @@ -71,6 +71,16 @@

Within absolute-positioned DIV

Content
+

Within overflowing absolute-positioned DIV

+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non velit nulla. Suspendisse sit amet tempus diam. Sed at ultricies neque. Suspendisse id felis a sem placerat ornare. Donec auctor, purus at molestie tempor, arcu enim molestie lacus, ac imperdiet massa urna eu massa. Praesent velit tellus, scelerisque a fermentum ut, ornare in diam. Phasellus egestas molestie feugiat. Vivamus sit amet viverra metus. +
Content
+
+ +
+
+
+

Next to a float element