This commit is contained in:
2024-08-25 14:45:49 +03:00
parent 7c4e19afbc
commit ffc39f078d
5 changed files with 25 additions and 34 deletions
+6 -5
View File
@@ -4,6 +4,7 @@
import "trix/dist/trix.css"
export let value = "";
export let field;
let editor;
@@ -28,9 +29,9 @@
e.preventDefault();
})
})
onDestroy(() => {
editor.removeEventListener("trix-before-initialize")
})
// onDestroy(() => {
// editor.removeEventListener("trix-before-initialize")
// })
Trix.config.blockAttributes.default.breakOnReturn = false
@@ -39,11 +40,11 @@
</script>
<div class="tox-wrapper">
<input id="x" {value} type="hidden">
<input id="x-{field.name}" {value} type="hidden">
<trix-editor
bind:this={editor}
class=" content"
input="x"
input="x-{field.name}"
role="textbox"
tabindex="0"
on:trix-change={updateValue}
@@ -26,9 +26,8 @@
<div class="mb-0">
<Trix bind:this={editor} bind:value></Trix>
<Trix {field} bind:this={editor} bind:value></Trix>
<!-- <Tinymce bind:this={editor} bind:value {additionalConfig}/>-->
<!-- <TipTap bind:value bind:this={editor} />-->
{#if field.collections.length > 0}
<RichEditorFiles
bind:graph