Do the filtering of reset / clear selection in one line

This commit is contained in:
shamoon 2024-04-07 17:41:57 -07:00
parent 26ec011e3e
commit 53e5f7289b

View File

@ -54,8 +54,13 @@ export class HotKeyService {
}
this.modalService.dismissAll()
if (e.key === 'Escape' && this.modalService.hasOpenModals()) {
// If there is a modal open, just dismiss
if (
e.key === 'Escape' &&
(this.modalService.hasOpenModals() ||
this.document.getElementsByClassName('dropdown-menu show').length >
0)
) {
// If there is a modal open or menu open, ignore the keydown event
return
}