fix: merge attrributes correctly when clicking task checkbox, fix #2422

This commit is contained in:
Philipp Kühn
2022-01-24 10:18:51 +01:00
parent 5a58153457
commit fe27843e80

View File

@@ -120,7 +120,11 @@ export const TaskItem = Node.create<TaskItemOptions>({
.chain()
.focus(undefined, { scrollIntoView: false })
.command(({ tr }) => {
tr.setNodeMarkup(getPos(), undefined, {
const position = getPos()
const currentNode = tr.doc.nodeAt(position)
tr.setNodeMarkup(position, undefined, {
...currentNode?.attrs,
checked,
})