If two editors are created, the existing editor is deleted. #2228
Answered
by
hanspagel
jskorlol
asked this question in
Questions & Help
-
If two editors are created, the existing editor is deleted. Alpine.data('editorData2', (content) => ({
editor: null,
updatedAt: Date.now(),
init() {
Alpine.nextTick(() => {
console.log(this.editor);
this.editor = new Editor({
element: this.$refs.editorReference,
extensions: [StarterKit],
content: content,
onCreate({ editor }) {
this.updatedAt = Date.now();
},
onUpdate({ editor }) {
this.updatedAt = Date.now();
},
onSelectionUpdate({ editor }) {
this.updatedAt = Date.now();
}
});
console.log(this.editor);
});
},
})); I use alpinejs. When new data is created by putting data in x-data, the editor is placed in the area of the div. From the second creation, the first editor is deleted. |
Beta Was this translation helpful? Give feedback.
Answered by
hanspagel
Dec 3, 2021
Replies: 1 comment 1 reply
-
Make sure to have different refs this.$refs.editorReference |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jskorlol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure to have different refs
this.$refs.editorReference