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

Commit 6e6748f

Browse files
committed
fix(uiSelectCtrl): scroll to active position on dropdown open in conjunction with $animate
The function `_ensureHighlightVisible()` that scrolls to the active (highlighted) element is never invoked at the end of the animation, when animation is used The logic that handles non animation opening is a bit different in that it scrolls to the highlighted element Updated the animation handler to perform similarly
1 parent 195ba86 commit 6e6748f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/uiSelectController.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,12 @@ uis.controller('uiSelectCtrl',
167167
if (phase === 'start' && ctrl.items.length === 0) {
168168
// Only focus input after the animation has finished
169169
ctrl.$animate.off('removeClass', searchInput[0], animateHandler);
170-
$timeout(function () {
171-
ctrl.focusSearchInput(initSearchValue);
172-
});
170+
_focusWhenReady(initSearchValue);
173171
}
174172
else if (phase === 'close') {
175173
// Only focus input after the animation has finished
176174
ctrl.$animate.off('enter', container[0], animateHandler);
177-
$timeout(function () {
178-
ctrl.focusSearchInput(initSearchValue);
179-
});
175+
_focusWhenReady(initSearchValue);
180176
}
181177
};
182178

0 commit comments

Comments
 (0)