From df04aa96367b18638ab3dbf4e45eae37a21b399c Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 11 Nov 2023 13:10:52 +0700 Subject: editor: re-render content after save This is to make the content that we save and the content on editor is always same. --- editor/editor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor.ts b/editor/editor.ts index 6bdbfca..e949951 100644 --- a/editor/editor.ts +++ b/editor/editor.ts @@ -171,7 +171,9 @@ export class WuiEditor { ev.preventDefault(); ev.stopPropagation(); if (ed.opts.onSave) { - ed.opts.onSave(ed.getContent()); + const content = ed.getContent(); + ed.opts.onSave(content); + ed.render(content); } } break; -- cgit v1.3