auto nesting or not, on add component

This commit is contained in:
Michael Shanks 2020-08-12 17:00:05 +01:00
parent 9ef748bf2d
commit 68eb3a8911
1 changed files with 8 additions and 3 deletions

View File

@ -293,9 +293,14 @@ const addChildComponent = store => (componentToAdd, presetProps = {}) => {
state state
) )
state.currentComponentInfo._children = state.currentComponentInfo._children.concat( const currentComponent =
newComponent.props state.components[state.currentComponentInfo._component]
)
const targetParent = currentComponent.children
? state.currentComponentInfo
: getParent(state.currentPreviewItem.props, state.currentComponentInfo)
targetParent._children = targetParent._children.concat(newComponent.props)
state.currentFrontEndType === "page" state.currentFrontEndType === "page"
? _savePage(state) ? _savePage(state)