Fix bugs, add timehash

This commit is contained in:
Jon Staab
2025-02-05 10:47:56 -08:00
parent f0b2b7c8b3
commit 5909b593ab
7 changed files with 72 additions and 41 deletions
+7 -6
View File
@@ -6,16 +6,17 @@
let element: HTMLElement
onMount(() => {
if (element) {
element.append(...(Array.from(editor.options.element.childNodes) as any))
editor.setOptions({element})
editor.contentElement = element
if (editor.options.element) {
element?.append(editor.options.element)
}
if (editor.options.autofocus) {
;(element?.querySelector("[contenteditable]") as HTMLElement)?.focus()
}
})
onDestroy(() => {
editor.contentElement = null
editor.setOptions({element: null})
editor.destroy()
})
</script>
+1
View File
@@ -50,6 +50,7 @@ export const makeEditor = ({
new Editor({
content,
autofocus,
element: document.createElement("div"),
extensions: [
WelshmanExtension.configure({
submit,