diff --git a/sharedComponents/search-input/search-input.component.ts b/sharedComponents/search-input/search-input.component.ts index 3703f89e..1327cc2e 100644 --- a/sharedComponents/search-input/search-input.component.ts +++ b/sharedComponents/search-input/search-input.component.ts @@ -53,6 +53,16 @@ export class SearchInputComponent implements OnInit { constructor(private cdr: ChangeDetectorRef) { } + @HostListener('window:keydown', ['$event']) + keyEvent(event: KeyboardEvent) { + if(this.input.focused) { + if(event.code === 'Enter') { + event.preventDefault(); + this.search(event); + } + } + } + @HostListener('document:click', ['$event']) click(event) { if(event.isTrusted && this.expandable && !this.disabled) { @@ -72,7 +82,7 @@ export class SearchInputComponent implements OnInit { } } - public search(event) { + public search(event) { if(!this.disabled) { if (this.expandable) { this.expand(!this.expanded);