Skip to content

Commit

Permalink
fix sentences search filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuffer authored and vsct-jburet committed Jul 20, 2023
1 parent 0734950 commit 077b5ca
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit {
}

filter(value: string): Group[] {
const filterValue = value.toLowerCase();
const filterValue = value?.toLowerCase();
return this.groups
.map((group) => {
return {
Expand Down Expand Up @@ -128,7 +128,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit {
if (selected === this.noFilter) {
this.filteredGroups$ = of(this.filter(''));
} else {
this.filteredGroups$ = of(this.filter(selected.toString()));
this.filteredGroups$ = of(this.filter(selected?.toString()));
}
if (selected) {
this.cachedValue = selected.label ?? selected.toString();
Expand All @@ -137,7 +137,7 @@ export class SearchFilterComponent implements OnInit, AfterViewInit {
}

onModelChange(value: string) {
const inputValue = value.toString().trim();
const inputValue = value?.toString().trim();
this.filteredGroups$ = of(this.filter(inputValue));
if (inputValue === '' && this.noFilter) {
this.filterChange.emit(this.noFilter.value);
Expand Down

0 comments on commit 077b5ca

Please sign in to comment.