Skip to content

Commit

Permalink
Don't call replaceChild when the view has no parentNode
Browse files Browse the repository at this point in the history
Issue #22
  • Loading branch information
marijnh committed Oct 15, 2021
1 parent 2a0d9ea commit e67f721
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class MenuBarView {
this.menu.className = prefix
this.spacer = null

editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom)
if (editorView.dom.parentNode)
editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom)
this.wrapper.appendChild(editorView.dom)

this.maxHeight = 0
Expand Down

0 comments on commit e67f721

Please sign in to comment.