File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ uis.controller('uiSelectCtrl',
18
18
ctrl . refreshDelay = uiSelectConfig . refreshDelay ;
19
19
ctrl . paste = uiSelectConfig . paste ;
20
20
21
+ ctrl . initSearchValue = EMPTY_SEARCH ;
21
22
ctrl . removeSelected = uiSelectConfig . removeSelected ; //If selected item(s) should be removed from dropdown list
22
23
ctrl . closeOnSelect = true ; //Initialized inside uiSelect directive link function
23
24
ctrl . skipFocusser = false ; //Set to true to avoid returning focus to ctrl when item is selected
@@ -109,6 +110,7 @@ uis.controller('uiSelectCtrl',
109
110
// When the user clicks on ui-select, displays the dropdown list
110
111
ctrl . activate = function ( initSearchValue , avoidReset ) {
111
112
if ( ! ctrl . disabled && ! ctrl . open ) {
113
+ initSearchValue = initSearchValue !== undefined ? initSearchValue : ctrl . initSearchValue ;
112
114
if ( ! avoidReset ) _resetSearchInput ( ) ;
113
115
114
116
$scope . $broadcast ( 'uis:activate' ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ uis.directive('uiSelect',
94
94
$select . removeSelected = removeSelected !== undefined ? removeSelected : uiSelectConfig . removeSelected ;
95
95
} ) ;
96
96
97
+ attrs . $observe ( 'initSearchValue' , function ( ) {
98
+ var initSearchValue = attrs . initSearchValue ;
99
+ $select . initSearchValue = initSearchValue !== undefined ? initSearchValue : '' ;
100
+ } ) ;
101
+
97
102
attrs . $observe ( 'disabled' , function ( ) {
98
103
// No need to use $eval() (thanks to ng-disabled) since we already get a boolean instead of a string
99
104
$select . disabled = attrs . disabled !== undefined ? attrs . disabled : false ;
You can’t perform that action at this time.
0 commit comments