For numbers, use e.key

pull/1176/head
Lim Chee Aun 2025-05-29 16:20:43 +08:00
rodzic d8525cc9b5
commit 6432e761b4
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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();

Wyświetl plik

@ -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) {