Keep the expanded state of the transformed node

This commit is contained in:
Jos de Jong 2020-09-02 10:59:19 +02:00
parent 00d0099355
commit 350969638c
1 changed files with 6 additions and 2 deletions

View File

@ -294,10 +294,14 @@ findRootPath
rootPath, rootPath,
onTransform: async (operations) => { onTransform: async (operations) => {
console.log('onTransform', rootPath, operations) console.log('onTransform', rootPath, operations)
const expanded = getIn(state, rootPath.concat(STATE_EXPANDED))
patch(operations, selection) 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, ...SIMPLE_MODAL_OPTIONS,