From 53e5f7289b8fb49f03f45a5dcb3afb41679fd3ff Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 7 Apr 2024 17:41:57 -0700 Subject: [PATCH] Do the filtering of reset / clear selection in one line --- src-ui/src/app/services/hot-key.service.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/services/hot-key.service.ts b/src-ui/src/app/services/hot-key.service.ts index 84dd16758..22a757581 100644 --- a/src-ui/src/app/services/hot-key.service.ts +++ b/src-ui/src/app/services/hot-key.service.ts @@ -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 }