fix #15140 bug with rich text bullet points

This commit is contained in:
ayana 2025-06-21 10:21:42 -07:00
parent 81b8267e85
commit 87eba030b2

View File

@ -59,6 +59,9 @@
export let shiftEnter = false; export let shiftEnter = false;
export let largeTextAsFile = false; export let largeTextAsFile = false;
let isUserEditing = false;
let lastSyncedValue = value;
let element; let element;
let editor; let editor;
@ -256,7 +259,9 @@
} }
if (value !== newValue) { if (value !== newValue) {
isUserEditing = true;
value = newValue; value = newValue;
lastSyncedValue = newValue;
// check if the node is paragraph as well // check if the node is paragraph as well
if (editor.isActive('paragraph')) { if (editor.isActive('paragraph')) {
@ -409,7 +414,9 @@
}); });
$: if (value !== null && editor) { $: if (value !== null && editor) {
onValueChange(); if (!isUserEditing && value !== lastSyncedValue) {
onValueChange();
}
} }
const onValueChange = () => { const onValueChange = () => {
@ -447,6 +454,8 @@
); // Update editor content ); // Update editor content
selectTemplate(); selectTemplate();
lastSyncedValue = value;
isUserEditing = false;
} }
} }
} }