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

fix(selectize): show placeholder when search disabled #1716

Closed
Closed
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
2 changes: 1 addition & 1 deletion src/selectize/match.tpl.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div ng-hide="$select.searchEnabled && ($select.open || $select.isEmpty())" class="ui-select-match" ng-transclude></div>
<div ng-hide="$select.open || $select.isEmpty()" class="ui-select-match" ng-transclude></div>
4 changes: 2 additions & 2 deletions src/selectize/select.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
ng-click="$select.toggle($event)"
placeholder="{{$select.placeholder}}"
ng-model="$select.search"
ng-hide="!$select.searchEnabled || (!$select.isEmpty() && !$select.open)"
ng-disabled="$select.disabled"
ng-hide="(!$select.isEmpty() && !$select.open)"
ng-disabled="!$select.searchEnabled || $select.disabled"
aria-label="{{ $select.baseTitle }}">
</div>
<div class="ui-select-choices"></div>
Expand Down
4 changes: 2 additions & 2 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1698,12 +1698,12 @@ describe('ui-select tests', function() {

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

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

});
Expand Down