Skip to content

Commit 580bde4

Browse files
committed
Merge branch 'victorenator-root-node' of https://github.com/victorenator/markdown-toolbar-element into victorenator-victorenator-root-node
2 parents c2c481b + 79fd194 commit 580bde4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class MarkdownToolbarElement extends HTMLElement {
298298
get field(): HTMLTextAreaElement | null {
299299
const id = this.getAttribute('for')
300300
if (!id) return null
301-
const field = document.getElementById(id)
301+
const field = (this.getRootNode() as Document | ShadowRoot).getElementById(id)
302302
return field instanceof HTMLTextAreaElement ? field : null
303303
}
304304
}

0 commit comments

Comments
 (0)