From a48a8c31fae9f7b25c82f762c94d51c35f27b2b7 Mon Sep 17 00:00:00 2001 From: sagivf Date: Wed, 3 Jun 2015 11:06:48 +0300 Subject: [PATCH] fix incorrect up direction class - document scroll position --- src/uiSelectDirective.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uiSelectDirective.js b/src/uiSelectDirective.js index fc6cc4138..fdb9b83dc 100644 --- a/src/uiSelectDirective.js +++ b/src/uiSelectDirective.js @@ -270,7 +270,7 @@ uis.directive('uiSelect', var offsetDropdown = uisOffset(dropdown); // Determine if the direction of the dropdown needs to be changed. - if (offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight) { + if (offset.top + offset.height + offsetDropdown.height > $document.find('body')[0].scrollTop + $document[0].documentElement.clientHeight) { dropdown[0].style.position = 'absolute'; dropdown[0].style.top = (offsetDropdown.height * -1) + 'px'; element.addClass(directionUpClassName);