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

Commit de489c6

Browse files
committed
fix(selectize): show placeholder when search disabled
Previously when searchEnabled was set to false, the placeholder would also be hidden on the selectize theme. This fix sets the search input to disabled rather then hidden when the searchEnabled attribute is set to false. Fixes #949 and #641
1 parent d1994fb commit de489c6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/selectize/match.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div ng-hide="$select.searchEnabled && ($select.open || $select.isEmpty())" class="ui-select-match" ng-transclude></div>
1+
<div ng-hide="$select.open || $select.isEmpty()" class="ui-select-match" ng-transclude></div>

src/selectize/select.tpl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
ng-click="$select.toggle($event)"
99
placeholder="{{$select.placeholder}}"
1010
ng-model="$select.search"
11-
ng-hide="!$select.searchEnabled || (!$select.isEmpty() && !$select.open)"
12-
ng-disabled="$select.disabled"
11+
ng-hide="(!$select.isEmpty() && !$select.open)"
12+
ng-disabled="!$select.searchEnabled || $select.disabled"
1313
aria-label="{{ $select.baseTitle }}">
1414
</div>
1515
<div class="ui-select-choices"></div>

test/select.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,12 +1698,12 @@ describe('ui-select tests', function() {
16981698

16991699
it('should show search input when true', function() {
17001700
setupSelectComponent(true, 'selectize');
1701-
expect($(el).find('.ui-select-search')).not.toHaveClass('ng-hide');
1701+
expect($(el).find('.ui-select-search').is(':disabled')).toBe(false);
17021702
});
17031703

17041704
it('should hide search input when false', function() {
17051705
setupSelectComponent(false, 'selectize');
1706-
expect($(el).find('.ui-select-search')).toHaveClass('ng-hide');
1706+
expect($(el).find('.ui-select-search').is(':disabled')).toBe(true);
17071707
});
17081708

17091709
});

0 commit comments

Comments
 (0)