Skip to content

Commit

Permalink
fix: move all child nodes within EditorContent
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed May 18, 2021
1 parent f829b45 commit 0f299d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/EditorContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito

const element = this.editorContentRef.current

element.appendChild(editor.options.element.firstChild)
element.append(...editor.options.element.childNodes)

editor.setOptions({
element,
Expand Down Expand Up @@ -89,7 +89,7 @@ export class PureEditorContent extends React.Component<EditorContentProps, Edito

const newElement = document.createElement('div')

newElement.appendChild(editor.options.element.firstChild)
newElement.append(...editor.options.element.childNodes)

editor.setOptions({
element: newElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-2/src/EditorContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const EditorContent: Component = {
return
}

element.appendChild(editor.options.element.firstChild)
element.append(...editor.options.element.childNodes)
editor.contentComponent = this

editor.setOptions({
Expand Down Expand Up @@ -62,7 +62,7 @@ export const EditorContent: Component = {

const newElement = document.createElement('div')

newElement.appendChild(editor.options.element.firstChild)
newElement.append(...editor.options.element.childNodes)

editor.setOptions({
element: newElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-3/src/EditorContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const EditorContent = defineComponent({

const element = unref(rootEl.value)

rootEl.value.appendChild(editor.options.element.firstChild)
rootEl.value.append(...editor.options.element.childNodes)

// @ts-ignore
editor.contentComponent = instance.ctx._
Expand Down Expand Up @@ -71,7 +71,7 @@ export const EditorContent = defineComponent({

const newElement = document.createElement('div')

newElement.appendChild(editor.options.element.firstChild)
newElement.append(...editor.options.element.childNodes)

editor.setOptions({
element: newElement,
Expand Down

0 comments on commit 0f299d2

Please sign in to comment.