kopia lustrzana https://github.com/cheeaun/phanpy
For numbers, use e.key
rodzic
d8525cc9b5
commit
6432e761b4
|
@ -57,9 +57,9 @@ function Columns() {
|
||||||
|
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
['1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
['1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||||
(e, handler) => {
|
(e) => {
|
||||||
try {
|
try {
|
||||||
const index = parseInt(handler.keys[0], 10) - 1;
|
const index = parseInt(e.key, 10) - 1;
|
||||||
const $column = document.querySelectorAll('#columns > *')[index];
|
const $column = document.querySelectorAll('#columns > *')[index];
|
||||||
if ($column) {
|
if ($column) {
|
||||||
$column.focus();
|
$column.focus();
|
||||||
|
|
|
@ -86,8 +86,8 @@ function Shortcuts() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
['1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
['1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||||
(e, handler) => {
|
(e) => {
|
||||||
const index = parseInt(handler.keys[0], 10) - 1;
|
const index = parseInt(e.key, 10) - 1;
|
||||||
if (index < formattedShortcuts.length) {
|
if (index < formattedShortcuts.length) {
|
||||||
const { path } = formattedShortcuts[index];
|
const { path } = formattedShortcuts[index];
|
||||||
if (path) {
|
if (path) {
|
||||||
|
|
Ładowanie…
Reference in New Issue