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 authored and lewish committed Aug 6, 2024
1 parent 56811aa commit b1b5e61
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 b1b5e61

Please sign in to comment.