Skip to content

Commit 9698f3b

Browse files
authored
Fix search a for element in shadow context
If markdown-toolbar-element and textarea are located in a shadow context, the element can't find the textarea.
1 parent c3630f6 commit 9698f3b

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
@@ -218,7 +218,7 @@ class MarkdownToolbarElement extends HTMLElement {
218218
get field(): ?HTMLTextAreaElement {
219219
const id = this.getAttribute('for')
220220
if (!id) return
221-
const field = document.getElementById(id)
221+
const field = this.getRootNode().getElementById(id)
222222
return field instanceof HTMLTextAreaElement ? field : null
223223
}
224224
}

0 commit comments

Comments
 (0)