Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix only the first item gets tasklist-ified issue
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
luka-nextcloud authored and nextcloud-command committed Dec 9, 2021
commit 81bfc7538a8beaaeb98fd4493febcb9aecb800f3
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions src/nodes/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,20 @@ export default class ListItem extends TiptapListItem {
return false
}

tr.setNodeMarkup(parentList.pos, schema.nodes.list_item, { type: parentList.node.attrs.type === TYPES.CHECKBOX ? TYPES.BULLET : TYPES.CHECKBOX })
if (parentList.node.attrs.type === TYPES.CHECKBOX) {
return toggleList(schema.nodes.bullet_list, type)(state, dispatch, view)
}

tr.doc.nodesBetween(tr.selection.from, tr.selection.to, (node, pos) => {
if (node.type === schema.nodes.list_item) {
tr.setNodeMarkup(pos, node.type, { type: parentList.node.attrs.type === TYPES.CHECKBOX ? TYPES.BULLET : TYPES.CHECKBOX })
}
})
tr.scrollIntoView()

if (dispatch) {
dispatch(tr)
}

}
},
}
Expand Down