diff --git a/src/uiSelectDirective.js b/src/uiSelectDirective.js index 3032d8168..e0b906d8f 100644 --- a/src/uiSelectDirective.js +++ b/src/uiSelectDirective.js @@ -295,6 +295,13 @@ uis.directive('uiSelect', scope.$watch('$select.open', function() { if ($select.dropdownPosition === 'auto' || $select.dropdownPosition === 'up'){ + // Hide the dropdown to avoid flickering on initial opening + dropdown = angular.element(element).querySelectorAll('.ui-select-dropdown'); + + if (dropdown.length > 0) { + dropdown[0].style.opacity = 0; + } + scope.calculateDropdownPos(); } @@ -331,9 +338,6 @@ uis.directive('uiSelect', return; } - // Hide the dropdown so there is no flicker until $timeout is done executing. - dropdown[0].style.opacity = 0; - // Delay positioning the dropdown until all choices have been added so its height is correct. $timeout(function(){