mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
Add missing editor content
This commit is contained in:
22
src/app/editor/EditorContent.svelte
Normal file
22
src/app/editor/EditorContent.svelte
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import {onDestroy, onMount} from "svelte"
|
||||||
|
|
||||||
|
const {editor} = $props()
|
||||||
|
|
||||||
|
let element: HTMLElement
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if (element) {
|
||||||
|
element.append(...(Array.from(editor.options.element.childNodes) as any))
|
||||||
|
editor.setOptions({element})
|
||||||
|
editor.contentElement = element
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
editor.contentElement = null
|
||||||
|
editor.setOptions({element: null})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div bind:this={element}></div>
|
||||||
Reference in New Issue
Block a user