diff --git a/assets/js/markdowntoolbar.ts b/assets/js/markdowntoolbar.ts index f8d23008..f9ceb840 100644 --- a/assets/js/markdowntoolbar.ts +++ b/assets/js/markdowntoolbar.ts @@ -271,7 +271,7 @@ function escapeSelection(textarea: HTMLTextAreaElement, options: Partial('.communication__toolbar__button'); + const button = event.target.closest('.communication__toolbar__button'); const toolbar = button?.closest('.communication__toolbar'); if (!button || !toolbar?.parentElement) return;