Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix(ui-select): avoid dropdown flickering on search #1557

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/uiSelectDirective.js
Original file line number Diff line number Diff line change
@@ -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(){