Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: stop trans. on nested task list init

thecodrr648913026884
diff --git a/packages/editor/src/extensions/task-list/component.tsx b/packages/editor/src/extensions/task-list/component.tsx
index d96833209..eb78ef7ad 100644
--- a/packages/editor/src/extensions/task-list/component.tsx
+++ b/packages/editor/src/extensions/task-list/component.tsx
@@ -36,6 +36,10 @@ export function TaskListComponent(
const { node, pos } = parentTaskItem;
const allChecked = areAllChecked(node, pos, editor.state.doc);
+ // no need to create a transaction if the check state is
+ // not changed.
+ if (node.attrs.checked === allChecked) return;
+
// check parent item if all child items are checked.
editor.commands.command(({ tr }) => {
tr.setNodeMarkup(pos, undefined, { checked: allChecked });