Skip to content

Commit

Permalink
fix(uiSelectCtrl): ensureHighlightVisible triggered with closed dropdown
Browse files Browse the repository at this point in the history
This fix ensures that the dropdown actually is open before calling
_ensureHighlightVisible.

Fixes: angular-ui#2050
  • Loading branch information
Stefan Zollinger authored and asiacomeau committed Jan 4, 2018
1 parent 3b00c3f commit 0bf25ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uiSelectController.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ uis.controller('uiSelectCtrl',
} else {
$timeout(function () {
ctrl.focusSearchInput(initSearchValue);
if(!ctrl.tagging.isActivated && ctrl.items.length > 1) {
if(!ctrl.tagging.isActivated && ctrl.items.length > 1 && ctrl.open) {
_ensureHighlightVisible();
}
});
Expand Down

0 comments on commit 0bf25ec

Please sign in to comment.