only lift list_item if we are currently in a list
this allows to use lists in blockquotes that are in another list.
This commit is contained in:
@@ -18,7 +18,7 @@ export default function toggleList(listType, itemType) {
|
|||||||
|
|
||||||
const parentList = findParentNode(node => isList(node, schema))(selection)
|
const parentList = findParentNode(node => isList(node, schema))(selection)
|
||||||
|
|
||||||
if (range.depth >= 1 && parentList) {
|
if (range.depth >= 1 && parentList && range.depth - parentList.depth <= 1) {
|
||||||
if (parentList.node.type === listType) {
|
if (parentList.node.type === listType) {
|
||||||
return liftListItem(itemType)(state, dispatch, view)
|
return liftListItem(itemType)(state, dispatch, view)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user