Commit 98229e9 1 parent b044b41 commit 98229e9 Copy full SHA for 98229e9
File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 349
349
ctrl . sizeSearchInput ( ) ;
350
350
} else {
351
351
ctrl . selected = item ;
352
+ var selectedFromDropdown = true ;
352
353
}
353
- ctrl . close ( skipFocusser ) ;
354
+ ctrl . close ( skipFocusser , selectedFromDropdown ) ;
354
355
}
355
356
} ;
356
357
357
358
// Closes the dropdown
358
- ctrl . close = function ( skipFocusser ) {
359
+ ctrl . close = function ( skipFocusser , selectedFromDropdown ) {
359
360
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
+ }
361
369
ctrl . open = false ;
362
370
if ( ! ctrl . multiple ) {
363
371
$timeout ( function ( ) {
You can’t perform that action at this time.
0 commit comments