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

Commit e0b5845

Browse files
author
Austin McDaniel
committed
Fix for #397
1 parent b044b41 commit e0b5845

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/select.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
* put as much logic in the controller (instead of the link functions) as possible so it can be easily tested.
138138
*/
139139
.controller('uiSelectCtrl',
140-
['$scope', '$element', '$timeout', 'RepeatParser', 'uiSelectMinErr',
141-
function($scope, $element, $timeout, RepeatParser, uiSelectMinErr) {
140+
['$scope', '$element', '$timeout', 'RepeatParser', 'uiSelectMinErr', 'uiSelectConfig',
141+
function($scope, $element, $timeout, RepeatParser, uiSelectMinErr, uiSelectConfig) {
142142

143143
var ctrl = this;
144144

@@ -171,7 +171,7 @@
171171

172172
// Most of the time the user does not want to empty the search input when in typeahead mode
173173
function _resetSearchInput() {
174-
if (ctrl.resetSearchInput) {
174+
if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {
175175
ctrl.search = EMPTY_SEARCH;
176176
//reset activeIndex
177177
if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {

test/select.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ describe('ui-select tests', function() {
253253
expect(isDropdownOpened(el2)).toEqual(true);
254254

255255
var el3 = createUiSelect();
256-
expect(el3.scope().$select.disabled).toEqual(false);
256+
expect(el3.scope().$select.disabled).toEqual(false || undefined);
257257
clickMatch(el3);
258258
expect(isDropdownOpened(el3)).toEqual(true);
259259
});

0 commit comments

Comments
 (0)