Skip to content

Commit 435e499

Browse files
committed
Merge pull request #1 from outbrain/fix-direction-up-bug
fix incorrect up direction class - document scroll position
2 parents 752283e + a48a8c3 commit 435e499

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uiSelectDirective.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ uis.directive('uiSelect',
270270
var offsetDropdown = uisOffset(dropdown);
271271

272272
// Determine if the direction of the dropdown needs to be changed.
273-
if (offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight) {
273+
if (offset.top + offset.height + offsetDropdown.height > $document.find('body')[0].scrollTop + $document[0].documentElement.clientHeight) {
274274
dropdown[0].style.position = 'absolute';
275275
dropdown[0].style.top = (offsetDropdown.height * -1) + 'px';
276276
element.addClass(directionUpClassName);

0 commit comments

Comments
 (0)