From 4a0be4523b45a4406f4f482edad080aa89b2b983 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 7 Oct 2022 14:34:47 +0100 Subject: [PATCH] Hide the selected component when dragging --- packages/client/src/stores/screens.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/client/src/stores/screens.js b/packages/client/src/stores/screens.js index e642fa9004..d5525d15c7 100644 --- a/packages/client/src/stores/screens.js +++ b/packages/client/src/stores/screens.js @@ -48,14 +48,14 @@ const createScreenStore = () => { } // Insert DND placeholder if required - const { dndParent, dndIndex } = $builderStore + const { dndParent, dndIndex, selectedComponentId } = $builderStore const insert = true if (insert && activeScreen && dndParent && dndIndex != null) { - // let selectedComponent = findComponentById( - // activeScreen.props, - // selectedComponentId - // ) - // delete selectedComponent._component + let selectedComponent = findComponentById( + activeScreen.props, + selectedComponentId + ) + delete selectedComponent._component const placeholder = { _component: "placeholder", _id: "placeholder",