From 6754d9c0eac5e15fa0de285fcf2b803f27ff295a Mon Sep 17 00:00:00 2001 From: Nicolas Echezarreta Date: Tue, 12 Nov 2024 10:24:24 -0300 Subject: [PATCH] fix shiftKey selection in Tree --- packages/@dcl/inspector/src/components/Tree/Tree.tsx | 4 ++-- packages/@dcl/inspector/src/lib/babylon/setup/input.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@dcl/inspector/src/components/Tree/Tree.tsx b/packages/@dcl/inspector/src/components/Tree/Tree.tsx index f64a91e95..f9123985d 100644 --- a/packages/@dcl/inspector/src/components/Tree/Tree.tsx +++ b/packages/@dcl/inspector/src/components/Tree/Tree.tsx @@ -152,10 +152,10 @@ export function Tree() { const quitInsertMode = () => setInsertMode(false) const handleSelect = (event: React.MouseEvent) => { - if (event.type === ClickType.CONTEXT_MENU && (event.ctrlKey || event.shiftKey)) { + if (event.type === ClickType.CONTEXT_MENU && event.ctrlKey) { onSelect(value, true) } else if (event.type === ClickType.CLICK) { - onSelect(value) + onSelect(value, event.shiftKey) if (event.detail > 1 && onDoubleSelect) onDoubleSelect(value) } } diff --git a/packages/@dcl/inspector/src/lib/babylon/setup/input.ts b/packages/@dcl/inspector/src/lib/babylon/setup/input.ts index 87f79929a..f7fee93c8 100644 --- a/packages/@dcl/inspector/src/lib/babylon/setup/input.ts +++ b/packages/@dcl/inspector/src/lib/babylon/setup/input.ts @@ -96,7 +96,7 @@ export function interactWithScene( const ancestors = getAncestors(engine, entity.entityId) const nodes = mapNodes(engine, (node) => (isAncestor(ancestors, node.entity) ? { ...node, open: true } : node)) operations.updateValue(editorComponents.Nodes, engine.RootEntity, { value: nodes }) - operations.updateSelectedEntity(entity.entityId, !!keyState[Keys.KEY_CTRL]) + operations.updateSelectedEntity(entity.entityId, !!keyState[Keys.KEY_CTRL] || !!keyState[Keys.KEY_SHIFT]) void operations.dispatch() }