mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
Fix handling for shortcuts (#926)
It turns out that `event.key` for ctrl/cmd+Z is `z`, and it’s `Z` for ctrl/cmd+shift+Z. --------- Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
This commit is contained in:
@@ -119,12 +119,12 @@ global.Actual = {
|
||||
document.addEventListener('keydown', e => {
|
||||
if (e.metaKey || e.ctrlKey) {
|
||||
// Cmd/Ctrl+o
|
||||
if (e.key === 'O') {
|
||||
if (e.key === 'o') {
|
||||
e.preventDefault();
|
||||
window.__actionsForMenu.closeBudget();
|
||||
}
|
||||
// Cmd/Ctrl+z
|
||||
else if (e.key === 'Z') {
|
||||
else if (e.key.toLowerCase() === 'z') {
|
||||
if (
|
||||
e.target.tagName === 'INPUT' ||
|
||||
e.target.tagName === 'TEXTAREA' ||
|
||||
|
||||
@@ -486,7 +486,7 @@ export const CellButton = React.forwardRef(
|
||||
className="cell-button"
|
||||
tabIndex="0"
|
||||
onKeyDown={e => {
|
||||
if (e.key === 'X' || e.key === ' ') {
|
||||
if (e.key === 'x' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
if (!disabled) {
|
||||
onSelect && onSelect();
|
||||
|
||||
6
upcoming-release-notes/926.md
Normal file
6
upcoming-release-notes/926.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [j-f1]
|
||||
---
|
||||
|
||||
Fix undo keyboard shortcut being ignored
|
||||
Reference in New Issue
Block a user