From 40179bba06228acf4015ca1efc552b800ee5da7e Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Fri, 28 Apr 2023 16:20:46 +0530 Subject: [PATCH] fix: Fixed issue where removing a collapsible block would unwrap the contents in reverse order --- .../Components/SuperEditor/Plugins/CollapsiblePlugin/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web/src/javascripts/Components/SuperEditor/Plugins/CollapsiblePlugin/index.ts b/packages/web/src/javascripts/Components/SuperEditor/Plugins/CollapsiblePlugin/index.ts index a3f660362..6afd51334 100644 --- a/packages/web/src/javascripts/Components/SuperEditor/Plugins/CollapsiblePlugin/index.ts +++ b/packages/web/src/javascripts/Components/SuperEditor/Plugins/CollapsiblePlugin/index.ts @@ -61,7 +61,7 @@ export default function CollapsiblePlugin(): JSX.Element | null { if (!$isCollapsibleContainerNode(parent)) { const children = node.getChildren() for (const child of children) { - node.insertAfter(child) + node.insertBefore(child) } node.remove() } @@ -76,7 +76,7 @@ export default function CollapsiblePlugin(): JSX.Element | null { const children = node.getChildren() if (children.length !== 2 || !$isCollapsibleTitleNode(children[0]) || !$isCollapsibleContentNode(children[1])) { for (const child of children) { - node.insertAfter(child) + node.insertBefore(child) } node.remove() }