Skip to content

Commit

Permalink
preventDefault() on Cmd+Z/Cmd+Shift+Z/Cmd+Y (#301)
Browse files Browse the repository at this point in the history
This commit calls `preventDefault()` for a few keyboard shortcuts. Partially addresses #189
  • Loading branch information
iamakulov committed Jun 12, 2024
1 parent 394b3cd commit 5f37c61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f37c61

Please sign in to comment.