From ea6bf7224cad04f9ab8e38efa1d0e8805f83db19 Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 9 May 2024 15:32:36 +0300 Subject: [PATCH] Add move hotkeys --- .../RSFormPage/EditorConstituenta/EditorConstituenta.tsx | 7 ++++--- .../src/pages/RSFormPage/EditorRSList/EditorRSList.tsx | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx index 89cdba2b..69154099 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/EditorConstituenta.tsx @@ -66,10 +66,11 @@ function EditorConstituenta({ activeCst, isModified, setIsModified, onOpenEdit } } function processAltKey(code: string): boolean { + // prettier-ignore switch (code) { - case 'KeyV': - controller.cloneCst(); - return true; + case 'ArrowUp': controller.moveUp(); return true; + case 'ArrowDown': controller.moveDown(); return true; + case 'KeyV': controller.cloneCst(); return true; } return false; } diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSList/EditorRSList.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSList/EditorRSList.tsx index af905965..f6de8e3a 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSList/EditorRSList.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSList/EditorRSList.tsx @@ -49,7 +49,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) { } } - function handleTableKey(event: React.KeyboardEvent) { + function handleKeyDown(event: React.KeyboardEvent) { if (!controller.isContentEditable || controller.isProcessing) { return; } @@ -97,7 +97,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) { return ( <> {controller.isContentEditable ? : null} - + {controller.isContentEditable ? (