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

Fix for #397 #399

Merged
merged 1 commit into from Nov 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
* put as much logic in the controller (instead of the link functions) as possible so it can be easily tested.
*/
.controller('uiSelectCtrl',
['$scope', '$element', '$timeout', 'RepeatParser', 'uiSelectMinErr',
function($scope, $element, $timeout, RepeatParser, uiSelectMinErr) {
['$scope', '$element', '$timeout', 'RepeatParser', 'uiSelectMinErr', 'uiSelectConfig',
function($scope, $element, $timeout, RepeatParser, uiSelectMinErr, uiSelectConfig) {

var ctrl = this;

Expand Down Expand Up @@ -171,7 +171,7 @@

// Most of the time the user does not want to empty the search input when in typeahead mode
function _resetSearchInput() {
if (ctrl.resetSearchInput) {
if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {
ctrl.search = EMPTY_SEARCH;
//reset activeIndex
if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {
Expand Down
2 changes: 1 addition & 1 deletion test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('ui-select tests', function() {
expect(isDropdownOpened(el2)).toEqual(true);

var el3 = createUiSelect();
expect(el3.scope().$select.disabled).toEqual(false);
expect(el3.scope().$select.disabled).toEqual(false || undefined);
clickMatch(el3);
expect(isDropdownOpened(el3)).toEqual(true);
});
Expand Down