Skip to content

Commit 9e1f966

Browse files
authored
Merge pull request #80 from github/fix-clicking-on-inner-elements-in-button
fix clicking on inner elements in button
2 parents 21ff272 + fe5ae6e commit 9e1f966

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function applyFromToolbar(event: Event) {
313313
if (!(target instanceof Element)) return
314314
const mdButton = target.closest('[data-md-button]')
315315
if (!mdButton || mdButton.closest('markdown-toolbar') !== currentTarget) return
316-
const mdButtonStyle = target.getAttribute('data-md-button')
316+
const mdButtonStyle = mdButton.getAttribute('data-md-button')
317317
const style = manualStyles[mdButtonStyle as keyof typeof manualStyles]
318318
if (!style) return
319319
event.preventDefault()

0 commit comments

Comments
 (0)