docs: force Alpine to rerender when the selection updates
This commit is contained in:
@@ -53,6 +53,7 @@ window.setupEditor = function(content) {
|
|||||||
return {
|
return {
|
||||||
editor: null,
|
editor: null,
|
||||||
content: content,
|
content: content,
|
||||||
|
updatedAt: Date.now(), // force Alpine to rerender on selection change
|
||||||
init(element) {
|
init(element) {
|
||||||
this.editor = new Editor({
|
this.editor = new Editor({
|
||||||
element: element,
|
element: element,
|
||||||
@@ -61,6 +62,9 @@ window.setupEditor = function(content) {
|
|||||||
onUpdate: ({ editor }) => {
|
onUpdate: ({ editor }) => {
|
||||||
this.content = editor.getHTML()
|
this.content = editor.getHTML()
|
||||||
},
|
},
|
||||||
|
onSelectionUpdate: () => {
|
||||||
|
this.updatedAt = Date.now()
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user