Skip to content

Commit 76058a8

Browse files
luka-nextcloudbackportbot[bot]
authored andcommitted
fix only the first item gets tasklist-ified issue
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent d667e9d commit 76058a8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/nodes/ListItem.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,20 @@ export default class ListItem extends TiptapListItem {
128128
return false
129129
}
130130

131-
tr.setNodeMarkup(parentList.pos, schema.nodes.list_item, { type: parentList.node.attrs.type === TYPES.CHECKBOX ? TYPES.BULLET : TYPES.CHECKBOX })
131+
if (parentList.node.attrs.type === TYPES.CHECKBOX) {
132+
return toggleList(schema.nodes.bullet_list, type)(state, dispatch, view)
133+
}
134+
135+
tr.doc.nodesBetween(tr.selection.from, tr.selection.to, (node, pos) => {
136+
if (node.type === schema.nodes.list_item) {
137+
tr.setNodeMarkup(pos, node.type, { type: parentList.node.attrs.type === TYPES.CHECKBOX ? TYPES.BULLET : TYPES.CHECKBOX })
138+
}
139+
})
132140
tr.scrollIntoView()
133141

134142
if (dispatch) {
135143
dispatch(tr)
136144
}
137-
138145
}
139146
},
140147
}

0 commit comments

Comments
 (0)