From 8d5e6deab437b5eebb267323bbff1779fbe4eda1 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Tue, 11 May 2021 19:23:36 +0200 Subject: [PATCH] docs: force Alpine to rerender when the selection updates --- docs/src/docPages/installation/alpine.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/docPages/installation/alpine.md b/docs/src/docPages/installation/alpine.md index 7913a142..5808c9ae 100644 --- a/docs/src/docPages/installation/alpine.md +++ b/docs/src/docPages/installation/alpine.md @@ -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() + }, }) }, }