Skip to content

Commit d285c1b

Browse files
committed
Merge pull request angular-ui#82 from bdelaforest/fix-active-item
Reset activeIndex on popup close in case we highlighted another choice without selecting it
2 parents dfb953c + 478796c commit d285c1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/select.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ angular.module('ui.select', [])
129129
function _resetSearchInput() {
130130
if (ctrl.resetSearchInput) {
131131
ctrl.search = EMPTY_SEARCH;
132+
//reset activeIndex
133+
if (ctrl.selected && ctrl.items.length) {
134+
ctrl.activeIndex = ctrl.items.indexOf(ctrl.selected);
135+
}
132136
}
133137
}
134138

@@ -284,7 +288,7 @@ angular.module('ui.select', [])
284288
}])
285289

286290
.directive('uiSelect',
287-
['$document', 'uiSelectConfig', 'uiSelectMinErr',
291+
['$document', 'uiSelectConfig', 'uiSelectMinErr',
288292
function($document, uiSelectConfig, uiSelectMinErr) {
289293

290294
return {

0 commit comments

Comments
 (0)