From 350969638c6b12a3c90c1f9652546b5a4839e523 Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Wed, 2 Sep 2020 10:59:19 +0200 Subject: [PATCH] Keep the expanded state of the transformed node --- src/components/treemode/TreeMode.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/treemode/TreeMode.svelte b/src/components/treemode/TreeMode.svelte index 5cae70a..cb5fad0 100644 --- a/src/components/treemode/TreeMode.svelte +++ b/src/components/treemode/TreeMode.svelte @@ -294,10 +294,14 @@ findRootPath rootPath, onTransform: async (operations) => { console.log('onTransform', rootPath, operations) + + const expanded = getIn(state, rootPath.concat(STATE_EXPANDED)) + patch(operations, selection) - // FIXME: replaced node should keep it's expanded state (if expanded) - + // keep the root nodes expanded state + await tick() + state = setIn(state, rootPath.concat(STATE_EXPANDED), expanded) } }, { ...SIMPLE_MODAL_OPTIONS,