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:
Chrissi2812 2019-05-20 15:44:11 +02:00
parent a0dae562c2
commit 2291c699ad
No known key found for this signature in database
GPG Key ID: B4B82C7E618271DA

View File

@ -18,7 +18,7 @@ export default function toggleList(listType, itemType) {
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) {
return liftListItem(itemType)(state, dispatch, view)
}