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