mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 18:49:02 +08:00
prevents invalid content in toggleList
This will skip the replace step for invalid content and instead inserts a new list of selected type
This commit is contained in:
parent
670936a160
commit
a0dae562c2
@ -23,7 +23,7 @@ export default function toggleList(listType, itemType) {
|
||||
return liftListItem(itemType)(state, dispatch, view)
|
||||
}
|
||||
|
||||
if (isList(parentList.node, schema)) {
|
||||
if (isList(parentList.node, schema) && listType.validContent(parentList.node.content)) {
|
||||
const { tr } = state
|
||||
tr.setNodeMarkup(parentList.pos, listType)
|
||||
if (dispatch) dispatch(tr)
|
||||
|
Loading…
Reference in New Issue
Block a user