From 6432e761b4cce56e4149bbd50b95dd36a77071ac Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 29 May 2025 16:20:43 +0800 Subject: [PATCH] For numbers, use e.key --- src/components/columns.jsx | 4 ++-- src/components/shortcuts.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/columns.jsx b/src/components/columns.jsx index 3f563514..238d911f 100644 --- a/src/components/columns.jsx +++ b/src/components/columns.jsx @@ -57,9 +57,9 @@ function Columns() { useHotkeys( ['1', '2', '3', '4', '5', '6', '7', '8', '9'], - (e, handler) => { + (e) => { try { - const index = parseInt(handler.keys[0], 10) - 1; + const index = parseInt(e.key, 10) - 1; const $column = document.querySelectorAll('#columns > *')[index]; if ($column) { $column.focus(); diff --git a/src/components/shortcuts.jsx b/src/components/shortcuts.jsx index 157d9538..365311a4 100644 --- a/src/components/shortcuts.jsx +++ b/src/components/shortcuts.jsx @@ -86,8 +86,8 @@ function Shortcuts() { const navigate = useNavigate(); useHotkeys( ['1', '2', '3', '4', '5', '6', '7', '8', '9'], - (e, handler) => { - const index = parseInt(handler.keys[0], 10) - 1; + (e) => { + const index = parseInt(e.key, 10) - 1; if (index < formattedShortcuts.length) { const { path } = formattedShortcuts[index]; if (path) {