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 1793237 commit 79fd194Copy full SHA for 79fd194
index.js
@@ -240,12 +240,10 @@ class MarkdownToolbarElement extends HTMLElement {
240
const id = this.getAttribute('for')
241
if (!id) return
242
const root = this.getRootNode()
243
- const field =
244
- root instanceof Document
245
- ? root.getElementById(id)
246
- : root instanceof DocumentFragment
247
- ? root.querySelector(`#${id}`)
248
- : null
+ let field = null
+ if (root instanceof Document || root instanceof DocumentFragment) {
+ field = root.querySelector(`#${id}`)
+ }
249
return field instanceof HTMLTextAreaElement ? field : null
250
}
251
0 commit comments