mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(editor): Restore V1 keybinding, Space Key to toggle panning (#10841)
This commit is contained in:
parent
c1d88f3bb3
commit
5a1db6db1a
|
@ -164,7 +164,7 @@ describe('Canvas', () => {
|
|||
const pane = canvas.querySelector('.vue-flow__pane');
|
||||
if (!pane) throw new Error('VueFlow pane not found');
|
||||
|
||||
await fireEvent.keyDown(pane, { view: window, key: 'Shift' });
|
||||
await fireEvent.keyDown(pane, { view: window, key: ' ' });
|
||||
await fireEvent.mouseDown(pane, { view: window });
|
||||
await fireEvent.mouseMove(pane, {
|
||||
view: window,
|
||||
|
@ -172,7 +172,7 @@ describe('Canvas', () => {
|
|||
clientY: 100,
|
||||
});
|
||||
await fireEvent.mouseUp(pane, { view: window });
|
||||
await fireEvent.keyUp(pane, { view: window, key: 'Shift' });
|
||||
await fireEvent.keyUp(pane, { view: window, key: ' ' });
|
||||
|
||||
vi.advanceTimersByTime(minimapTransitionDuration);
|
||||
await waitFor(() => expect(getByTestId('canvas-minimap')).toBeVisible());
|
||||
|
@ -196,7 +196,7 @@ describe('Canvas', () => {
|
|||
const pane = canvas.querySelector('.vue-flow__pane');
|
||||
if (!pane) throw new Error('VueFlow pane not found');
|
||||
|
||||
await fireEvent.keyDown(pane, { view: window, key: 'Shift' });
|
||||
await fireEvent.keyDown(pane, { view: window, key: ' ' });
|
||||
await fireEvent.mouseDown(pane, { view: window });
|
||||
await fireEvent.mouseMove(pane, {
|
||||
view: window,
|
||||
|
@ -204,7 +204,7 @@ describe('Canvas', () => {
|
|||
clientY: 100,
|
||||
});
|
||||
await fireEvent.mouseUp(pane, { view: window });
|
||||
await fireEvent.keyUp(pane, { view: window, key: 'Shift' });
|
||||
await fireEvent.keyUp(pane, { view: window, key: ' ' });
|
||||
|
||||
vi.advanceTimersByTime(minimapTransitionDuration);
|
||||
await waitFor(() => expect(getByTestId('canvas-minimap')).toBeVisible());
|
||||
|
|
|
@ -122,7 +122,10 @@ const classes = computed(() => ({
|
|||
|
||||
const disableKeyBindings = computed(() => !props.keyBindings);
|
||||
|
||||
const panningKeyCode = 'Shift';
|
||||
/**
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values#whitespace_keys
|
||||
*/
|
||||
const panningKeyCode = ' ';
|
||||
const isPanningEnabled = ref(false);
|
||||
|
||||
onKeyDown(panningKeyCode, () => {
|
||||
|
|
Loading…
Reference in a new issue