fix(editor): Fix canvas keybindings using splitter keys such as zooming using + key (#12022)

This commit is contained in:
Alex Grozav
2024-12-04 09:35:41 +02:00
committed by GitHub
parent d3bb0b6d41
commit 6af9c82af6
3 changed files with 34 additions and 7 deletions

View File

@@ -205,8 +205,8 @@ const keyMap = computed(() => ({
ctrl_c: emitWithSelectedNodes((ids) => emit('copy:nodes', ids)),
enter: emitWithLastSelectedNode((id) => onSetNodeActive(id)),
ctrl_a: () => addSelectedNodes(graphNodes.value),
'+|=': async () => await onZoomIn(),
'-|_': async () => await onZoomOut(),
'shift_+|+|=': async () => await onZoomIn(),
'shift+_|-|_': async () => await onZoomOut(),
0: async () => await onResetZoom(),
1: async () => await onFitView(),
ArrowUp: emitWithLastSelectedNode(selectUpperSiblingNode),
@@ -215,7 +215,6 @@ const keyMap = computed(() => ({
ArrowRight: emitWithLastSelectedNode(selectRightNode),
shift_ArrowLeft: emitWithLastSelectedNode(selectUpstreamNodes),
shift_ArrowRight: emitWithLastSelectedNode(selectDownstreamNodes),
// @TODO implement arrow key shortcuts to modify selection
...(props.readOnly
? {}