mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 18:23:31 +00:00
Merge pull request #1617 from lionel-rowe/close-popup-on-esc
Close browser popup on Escape key press
This commit is contained in:
@@ -357,4 +357,11 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
closeOnEsc(e: KeyboardEvent) {
|
||||
// If input not empty, use browser default behavior of clearing input instead
|
||||
if (e.key === 'Escape' && (this.searchText == null || this.searchText === '')) {
|
||||
BrowserApi.closePopup(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user