trix
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user