We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9698f3b commit 4ec9162Copy full SHA for 4ec9162
index.js
@@ -218,7 +218,13 @@ class MarkdownToolbarElement extends HTMLElement {
218
get field(): ?HTMLTextAreaElement {
219
const id = this.getAttribute('for')
220
if (!id) return
221
- const field = this.getRootNode().getElementById(id)
+ const root = this.getRootNode()
222
+ const field =
223
+ root instanceof Document
224
+ ? root.getElementById(id)
225
+ : root instanceof DocumentFragment
226
+ ? root.querySelector(`#${id}`)
227
+ : null
228
return field instanceof HTMLTextAreaElement ? field : null
229
}
230
0 commit comments