From 1052d9c16a6920889b9b51d199b0dcc928b78e8b Mon Sep 17 00:00:00 2001 From: Xinyi Xu Date: Tue, 18 Oct 2022 08:52:51 -0700 Subject: [PATCH] fix(composer): fix adding tag always attached to root (#281) --- .../toolbars/floatingToolbar/items/AddObjectMenu.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/scene-composer/src/components/toolbars/floatingToolbar/items/AddObjectMenu.tsx b/packages/scene-composer/src/components/toolbars/floatingToolbar/items/AddObjectMenu.tsx index ced0c6fdd..9241a2815 100644 --- a/packages/scene-composer/src/components/toolbars/floatingToolbar/items/AddObjectMenu.tsx +++ b/packages/scene-composer/src/components/toolbars/floatingToolbar/items/AddObjectMenu.tsx @@ -79,7 +79,7 @@ export const AddObjectMenu = () => { const selectedSceneNode = useMemo(() => { return getSceneNodeByRef(selectedSceneNodeRef); - }, [selectedSceneNodeRef]); + }, [getSceneNodeByRef, selectedSceneNodeRef]); const sceneContainsEnvironmentModel = useMemo(() => { return ( @@ -135,7 +135,7 @@ export const AddObjectMenu = () => { const getRefForParenting = useCallback(() => { return !isEnvironmentNode(selectedSceneNode) ? selectedSceneNodeRef : undefined; - }, [getSceneNodeByRef, selectedSceneNodeRef, selectedSceneNode]); + }, [selectedSceneNodeRef, selectedSceneNode]); const handleAddAnchor = useCallback(() => { const anchorComponent: IAnchorComponent = { @@ -151,7 +151,7 @@ export const AddObjectMenu = () => { } else { appendSceneNode(node); } - }, [enhancedEditingEnabled]); + }, [enhancedEditingEnabled, getRefForParenting, appendSceneNode, setAddingWidget]); const handleAddColorOverlay = () => { // Requires a selected scene node