From 9880f14f5434c14826813fc1a04ec18840396d8b Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Mon, 10 Jun 2024 21:26:59 +0200 Subject: [PATCH] `preventDefault()` on Cmd+Z/Cmd+Shift+Z/Cmd+Y This commit calls `preventDefault()` for a few keyboard shortcuts. Partially addresses https://github.com/lewish/asciiflow/issues/189 --- client/controller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/controller.ts b/client/controller.ts index 1fb0275..edb6837 100644 --- a/client/controller.ts +++ b/client/controller.ts @@ -103,9 +103,13 @@ export class Controller { } else { store.currentCanvas.undo(); } + // Disable browser-specific behavior on Cmd/Ctrl+Z: https://github.com/lewish/asciiflow/issues/189 + event.preventDefault(); } if (event.keyCode === 89) { store.currentCanvas.redo(); + // Disable browser-specific behavior on Cmd/Ctrl+Y: https://github.com/lewish/asciiflow/issues/189 + event.preventDefault(); } if (event.keyCode === 88) { specialKeyCode = constants.KEY_CUT;