From 87af09bd23a3caf34fb1d26c9ed72f0793f1bcc5 Mon Sep 17 00:00:00 2001 From: Robert Pocklington Date: Mon, 9 May 2016 11:26:38 +1000 Subject: [PATCH] Remove flicker on search but preserve original hide when dropdown not visible --- src/uiSelectDirective.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/uiSelectDirective.js b/src/uiSelectDirective.js index 3032d8168..dfb689d40 100644 --- a/src/uiSelectDirective.js +++ b/src/uiSelectDirective.js @@ -323,6 +323,8 @@ uis.directive('uiSelect', }; + var opened = false; + scope.calculateDropdownPos = function(){ if ($select.open) { @@ -331,8 +333,11 @@ uis.directive('uiSelect', return; } - // Hide the dropdown so there is no flicker until $timeout is done executing. - dropdown[0].style.opacity = 0; + // Hide the dropdown so there is no flicker until $timeout is done executing. + if ($select.search === '' && !opened) { + dropdown[0].style.opacity = 0; + opened = true; + } // Delay positioning the dropdown until all choices have been added so its height is correct. $timeout(function(){