Skip to content

Commit 98229e9

Browse files
committed
added /tag/ functionality
1 parent b044b41 commit 98229e9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

dist/select.js

100755100644
+11-3
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,23 @@
349349
ctrl.sizeSearchInput();
350350
} else {
351351
ctrl.selected = item;
352+
var selectedFromDropdown = true;
352353
}
353-
ctrl.close(skipFocusser);
354+
ctrl.close(skipFocusser, selectedFromDropdown);
354355
}
355356
};
356357

357358
// Closes the dropdown
358-
ctrl.close = function(skipFocusser) {
359+
ctrl.close = function(skipFocusser, selectedFromDropdown) {
359360
if (!ctrl.open) return;
360-
_resetSearchInput();
361+
if (ctrl.search) {
362+
ctrl.selected = { name: ctrl.search, id: null} // id set as null for form validation
363+
}
364+
else {
365+
if (!selectedFromDropdown){
366+
ctrl.selected = undefined;
367+
}
368+
}
361369
ctrl.open = false;
362370
if (!ctrl.multiple){
363371
$timeout(function(){

0 commit comments

Comments
 (0)