From 2291c699ad2d35cbb29061fd57a02ec09b0061a1 Mon Sep 17 00:00:00 2001 From: Chrissi2812 Date: Mon, 20 May 2019 15:44:11 +0200 Subject: [PATCH] only lift list_item if we are currently in a list this allows to use lists in blockquotes that are in another list. --- packages/tiptap-commands/src/commands/toggleList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tiptap-commands/src/commands/toggleList.js b/packages/tiptap-commands/src/commands/toggleList.js index 8d71b73f..6e7adab3 100644 --- a/packages/tiptap-commands/src/commands/toggleList.js +++ b/packages/tiptap-commands/src/commands/toggleList.js @@ -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) }