Skip to content

Commit aa0c1e9

Browse files
committed
don't show search, checkAll, uncheck options when just have one element to show
1 parent 6dc7524 commit aa0c1e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dropdown/dropdown.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(scroll)="settings.isLazyLoad ? checkScrollPosition($event) : null" (wheel)="settings.stopScrollPropagation ? checkScrollPropagation($event, scroller) : null"
99
[class.pull-right]="settings.pullRight" [class.dropdown-menu-right]="settings.pullRight" [style.max-height]="settings.maxHeight"
1010
style="display: block; height: auto; overflow-y: auto;" (keydown.tab)="focusItem(1, $event)" (keydown.shift.tab)="focusItem(-1, $event)">
11-
<div class="input-group search-container" *ngIf="settings.enableSearch">
11+
<div class="input-group search-container" *ngIf="settings.enableSearch && renderFilteredOptions.length > 1">
1212
<div class="input-group-prepend">
1313
<span class="input-group-text" id="basic-addon1">
1414
<i class="fa fa-search" aria-hidden="true"></i>
@@ -22,12 +22,12 @@
2222
</button>
2323
</div>
2424
</div>
25-
<a role="menuitem" href="javascript:;" tabindex="-1" class="dropdown-item check-control check-control-check" *ngIf="settings.showCheckAll && !disabledSelection"
25+
<a role="menuitem" href="javascript:;" tabindex="-1" class="dropdown-item check-control check-control-check" *ngIf="settings.showCheckAll && !disabledSelection && renderFilteredOptions.length > 1"
2626
(click)="checkAll()">
2727
<span style="width: 16px;"><span [ngClass]="{'glyphicon glyphicon-ok': settings.checkedStyle !== 'fontawesome','fa fa-check': settings.checkedStyle === 'fontawesome'}"></span></span>
2828
{{ texts.checkAll }}
2929
</a>
30-
<a role="menuitem" href="javascript:;" tabindex="-1" class="dropdown-item check-control check-control-uncheck" *ngIf="settings.showUncheckAll && !disabledSelection"
30+
<a role="menuitem" href="javascript:;" tabindex="-1" class="dropdown-item check-control check-control-uncheck" *ngIf="settings.showUncheckAll && !disabledSelection && renderFilteredOptions.length > 1"
3131
(click)="uncheckAll()">
3232
<span style="width: 16px;"><span [ngClass]="{'glyphicon glyphicon-remove': settings.checkedStyle !== 'fontawesome','fa fa-times': settings.checkedStyle === 'fontawesome'}"></span></span>
3333
{{ texts.uncheckAll }}

0 commit comments

Comments
 (0)