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

Commit f6c0e1f

Browse files
committed
fix(choices): reset activeMatchIndex on blur
1 parent 8845afd commit f6c0e1f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/select.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@
349349
// Closes the dropdown
350350
ctrl.close = function(skipFocusser) {
351351
if (!ctrl.open) return;
352-
_resetSearchInput();
353-
ctrl.open = false;
352+
_resetSearchInput();
353+
ctrl.open = false;
354354
if (!ctrl.multiple){
355355
$timeout(function(){
356356
ctrl.focusser.prop('disabled', false);
@@ -524,14 +524,11 @@
524524

525525
});
526526

527-
// _searchInput.on('blur', function() {
528-
// console.log("blurring");
529-
// // $timeout(function() {
530-
// // ctrl.activeMatchIndex = -1;
531-
// // ctrl.activeIndex = 0;
532-
// // console.log("blurring done");
533-
// // });
534-
// });
527+
_searchInput.on('blur', function() {
528+
$timeout(function() {
529+
ctrl.activeMatchIndex = -1;
530+
});
531+
});
535532

536533
function _getCaretPosition(el) {
537534
if(angular.isNumber(el.selectionStart)) return el.selectionStart;

0 commit comments

Comments
 (0)