From 2733d07f941013db0c6faf864f323d6478491637 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 1 Mar 2024 17:05:50 +0000 Subject: [PATCH] allow clicking on svgs in buttons --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 02f0310..a6a502d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -310,7 +310,7 @@ if (!window.customElements.get('md-strikethrough')) { function applyFromToolbar(event: Event) { const {target, currentTarget} = event - if (!(target instanceof HTMLElement)) return + if (!(target instanceof Element)) return const mdButton = target.closest('[data-md-button]') if (!mdButton || mdButton.closest('markdown-toolbar') !== currentTarget) return const mdButtonStyle = target.getAttribute('data-md-button')