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

Commit a259a3c

Browse files
committed
Closes a dropdown when another one is opened
1 parent 90b7b14 commit a259a3c

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/node_modules
33
/.idea
44
/.tmp
5+
.DS_Store

src/select.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
$timeout(function() {
212212
ctrl.search = initSearchValue || ctrl.search;
213213
_searchInput[0].focus();
214-
});
214+
}, 50);
215215
}
216216
};
217217

@@ -434,9 +434,13 @@
434434

435435
// Toggle dropdown
436436
ctrl.toggle = function(e) {
437-
if (ctrl.open) ctrl.close(); else ctrl.activate();
438-
e.preventDefault();
439-
e.stopPropagation();
437+
if (ctrl.open) {
438+
ctrl.close();
439+
e.preventDefault();
440+
e.stopPropagation();
441+
} else {
442+
ctrl.activate();
443+
}
440444
};
441445

442446
ctrl.isLocked = function(itemScope, itemIndex) {

0 commit comments

Comments
 (0)