diff --git a/frontend/src/app/modules/global_search/global-search-input.component.html b/frontend/src/app/modules/global_search/global-search-input.component.html index 3db09acf04..e3aaaa5c9e 100644 --- a/frontend/src/app/modules/global_search/global-search-input.component.html +++ b/frontend/src/app/modules/global_search/global-search-input.component.html @@ -32,8 +32,9 @@ (open)="openCloseMenu(currentValue)" (close)="select.filterValue = currentValue" (change)="onChange($event)" - (clear)="clearSearch()" - (keydown.enter)="onEnterBeforeResultsLoaded()"> + (keydown.enter)="onEnterBeforeResultsLoaded()" + (keydown.escape)="blur()" + (clear)="clearSearch()">
diff --git a/frontend/src/app/modules/global_search/global-search-input.component.ts b/frontend/src/app/modules/global_search/global-search-input.component.ts index 1819033d77..37c6ad9a33 100644 --- a/frontend/src/app/modules/global_search/global-search-input.component.ts +++ b/frontend/src/app/modules/global_search/global-search-input.component.ts @@ -310,6 +310,10 @@ export class GlobalSearchInputComponent implements OnInit, OnDestroy { } } + public blur() { + ( document.activeElement).blur(); + } + private redirectToWp(id:string) { window.location = this.PathHelperService.workPackagePath(id) as unknown as Location; }