From fe5ae6ef08156e62c10f3499bcd3951607cac952 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 1 Mar 2024 17:41:34 +0000 Subject: [PATCH] fix clicking on inner elements in button --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a6a502d..9c76c20 100644 --- a/src/index.ts +++ b/src/index.ts @@ -313,7 +313,7 @@ function applyFromToolbar(event: Event) { 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') + const mdButtonStyle = mdButton.getAttribute('data-md-button') const style = manualStyles[mdButtonStyle as keyof typeof manualStyles] if (!style) return event.preventDefault()