diff --git a/src/portal/lib/src/filter/filter.component.ts b/src/portal/lib/src/filter/filter.component.ts index a0518a270..28b89dcb5 100644 --- a/src/portal/lib/src/filter/filter.component.ts +++ b/src/portal/lib/src/filter/filter.component.ts @@ -46,7 +46,7 @@ export class FilterComponent implements OnInit { valueChange(): void { // Send out filter terms - this.filterTerms.next(this.currentValue.trim()); + this.filterTerms.next(this.currentValue && this.currentValue.trim()); } inputFocus(): void { diff --git a/src/portal/lib/src/log/recent-log.component.spec.ts b/src/portal/lib/src/log/recent-log.component.spec.ts index 6910cf74f..d76722dba 100644 --- a/src/portal/lib/src/log/recent-log.component.spec.ts +++ b/src/portal/lib/src/log/recent-log.component.spec.ts @@ -204,7 +204,7 @@ describe('RecentLogComponent (inline template)', () => { els = fixture.nativeElement.querySelectorAll('.datagrid-row'); expect(els).toBeTruthy(); - expect(els.length).toEqual(16); + expect(els.length).toEqual(4); }); }); diff --git a/src/portal/lib/src/log/recent-log.component.ts b/src/portal/lib/src/log/recent-log.component.ts index 7c615295c..a8a3b3b17 100644 --- a/src/portal/lib/src/log/recent-log.component.ts +++ b/src/portal/lib/src/log/recent-log.component.ts @@ -67,6 +67,9 @@ export class RecentLogComponent implements OnInit { } public doFilter(terms: string): void { + if (!terms) { + return; + } this.currentTerm = terms.trim(); // Trigger data loading and start from first page this.loading = true;