mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-02 20:50:17 -05:00
Fix undo shortcut sometimes not working
Same deal - does the Shift modifier also modify the character? Just allow both. Fixes #457.
This commit is contained in:
parent
46bc36861e
commit
d2e211796b
1 changed files with 10 additions and 7 deletions
|
@ -211,12 +211,15 @@ keyHandlers[ctrlKey + 'z'] = (self: Squire, event: KeyboardEvent): void => {
|
|||
event.preventDefault();
|
||||
self.undo();
|
||||
};
|
||||
keyHandlers[ctrlKey + 'y'] = keyHandlers[ctrlKey + 'Shift-z'] = (
|
||||
self: Squire,
|
||||
event: KeyboardEvent,
|
||||
): void => {
|
||||
event.preventDefault();
|
||||
self.redo();
|
||||
};
|
||||
keyHandlers[ctrlKey + 'y'] =
|
||||
// Depending on platform, the Shift may cause the key to come through as
|
||||
// upper case, but sometimes not. Just add both as shortcuts — the browser
|
||||
// will only ever fire one or the other.
|
||||
keyHandlers[ctrlKey + 'Shift-z'] =
|
||||
keyHandlers[ctrlKey + 'Shift-Z'] =
|
||||
(self: Squire, event: KeyboardEvent): void => {
|
||||
event.preventDefault();
|
||||
self.redo();
|
||||
};
|
||||
|
||||
export { _onKey, keyHandlers };
|
||||
|
|
Loading…
Reference in a new issue