Skip to content

Commit

Permalink
fix shiftKey selection in Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoecheza committed Nov 12, 2024
1 parent e569cd0 commit 6754d9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/@dcl/inspector/src/components/Tree/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ export function Tree<T>() {
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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@dcl/inspector/src/lib/babylon/setup/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 6754d9c

Please sign in to comment.