From e73afff364417a84f53417b044a6757a25ea8d15 Mon Sep 17 00:00:00 2001 From: Matthias risto Date: Tue, 17 Sep 2024 17:25:02 +0200 Subject: [PATCH] feat: close slash menu on escape --- .../suggestions-menu/bna-suggestions-menu.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/ngx-blocknote/src/lib/components/suggestions-menu/bna-suggestions-menu.component.ts b/libs/ngx-blocknote/src/lib/components/suggestions-menu/bna-suggestions-menu.component.ts index 9c97168..bbcdedb 100644 --- a/libs/ngx-blocknote/src/lib/components/suggestions-menu/bna-suggestions-menu.component.ts +++ b/libs/ngx-blocknote/src/lib/components/suggestions-menu/bna-suggestions-menu.component.ts @@ -56,6 +56,10 @@ export class BnaSuggestionsMenuComponent implements OnInit, OnDestroy { event.preventDefault(); this.insertSelectedBlock(); return; + } else if (event.key === 'Escape') { + event.preventDefault(); + this.ngxBlockNoteService.editor().suggestionMenus.closeMenu(); + return; } } selectedIndex = 0;