diff --git a/apps/browser/src/popup/vault/vault-select.component.ts b/apps/browser/src/popup/vault/vault-select.component.ts index 4ed1dead32c..d9dca42f24c 100644 --- a/apps/browser/src/popup/vault/vault-select.component.ts +++ b/apps/browser/src/popup/vault/vault-select.component.ts @@ -11,6 +11,7 @@ import { TemplateRef, ViewChild, ViewContainerRef, + HostListener, } from "@angular/core"; import { merge } from "rxjs"; @@ -87,6 +88,14 @@ export class VaultSelectComponent implements OnInit { private platformUtilsService: PlatformUtilsService ) {} + @HostListener("document:keydown.escape", ["$event"]) + handleKeyboardEvent(event: KeyboardEvent) { + if (this.isOpen) { + event.preventDefault(); + this.close(); + } + } + async ngOnInit() { await this.load(); this.broadcasterService.subscribe(this.constructor.name, (message: any) => {