Skip to content

Commit fa869bd

Browse files
keithamusmuan
andauthored
fix: check currentTarget is closest to button invoking keypress
Co-Authored-By: Mu-An 慕安 <[email protected]>
1 parent bf0fde1 commit fa869bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function focusKeydown(toolbar: MarkdownToolbarElement, event: KeyboardEvent) {
265265
const target = event.target
266266
if (!(target instanceof HTMLElement)) return
267267
if (!target.hasAttribute('data-md-button')) return
268-
if (target.closest('markdown-toolbar') !== toolbar) return
268+
if (target.closest('markdown-toolbar') !== event.currentTarget) return
269269

270270
const buttons = []
271271
for (const button of toolbar.querySelectorAll('[data-md-button]')) {

0 commit comments

Comments
 (0)