fix(editor): keep multi-selection on right click
This commit is contained in:
parent
3e353c6322
commit
a5ec482bd5
@ -427,6 +427,10 @@ export function Canvas(props: CanvasProps) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (node.locked) return;
|
if (node.locked) return;
|
||||||
|
|
||||||
|
// Right-click selection is handled by the contextmenu handler.
|
||||||
|
// Important: don't collapse a multi-selection on pointerdown.
|
||||||
|
if (e.button === 2) return;
|
||||||
|
|
||||||
// ctrl click: multi-select toggle
|
// ctrl click: multi-select toggle
|
||||||
if (props.keyboard.ctrl) {
|
if (props.keyboard.ctrl) {
|
||||||
props.onToggleSelect(node.id);
|
props.onToggleSelect(node.id);
|
||||||
@ -434,9 +438,6 @@ export function Canvas(props: CanvasProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
props.onSelectSingle(node.id);
|
props.onSelectSingle(node.id);
|
||||||
// right click should not start move
|
|
||||||
if (e.button === 2) return;
|
|
||||||
|
|
||||||
props.onBeginMove(e);
|
props.onBeginMove(e);
|
||||||
}}
|
}}
|
||||||
onContextMenu={(e) => openContextMenu(e, node.id)}
|
onContextMenu={(e) => openContextMenu(e, node.id)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user