Skip to content

Commit

Permalink
Search filter "No filtered data found" message added + Dropdown close…
Browse files Browse the repository at this point in the history
…/reopen issue fixed (#322)

* Fix #122 #315

* Fix #198 #295 #302
  • Loading branch information
ninilo97 authored Jan 25, 2022
1 parent 5b3a4a5 commit c35294f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/ng-multiselect-dropdown/src/multi-select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<input type="checkbox" [attr.aria-label]="item.text" [checked]="isSelected(item)" [disabled]="disabled || (isLimitSelectionReached() && !isSelected(item)) || item.isDisabled" />
<div>{{item.text}}</div>
</li>
<li class='no-filtered-data' *ngIf="_data.length != 0 && (_data | multiSelectFilter:filter).length == 0 && !_settings.allowRemoteDataSearch">
<h5>{{_settings.noFilteredDataAvailablePlaceholderText}}</h5>
</li>
<li class='no-data' *ngIf="_data.length == 0 && !_settings.allowRemoteDataSearch">
<h5>{{_settings.noDataAvailablePlaceholderText}}</h5>
</li>
Expand Down
3 changes: 2 additions & 1 deletion src/ng-multiselect-dropdown/src/multiselect.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class MultiSelectComponent implements ControlValueAccessor {
itemsShowLimit: 999999999999,
searchPlaceholderText: "Search",
noDataAvailablePlaceholderText: "No data available",
noFilteredDataAvailablePlaceholderText: "No filtered data available",
closeDropDownOnSelection: false,
showSelectedItemsAtTop: false,
defaultOpen: false,
Expand Down Expand Up @@ -191,7 +192,7 @@ export class MultiSelectComponent implements ControlValueAccessor {
// Set touched on blur
@HostListener("blur")
public onTouched() {
this.closeDropdown();
// this.closeDropdown();
this.onTouchedCallback();
}

Expand Down
1 change: 1 addition & 0 deletions src/ng-multiselect-dropdown/src/multiselect.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface IDropdownSettings {
limitSelection?: number;
searchPlaceholderText?: string;
noDataAvailablePlaceholderText?: string;
noFilteredDataAvailablePlaceholderText?: string;
closeDropDownOnSelection?: boolean;
showSelectedItemsAtTop?: boolean;
defaultOpen?: boolean;
Expand Down

0 comments on commit c35294f

Please sign in to comment.