Add move hotkeys

This commit is contained in:
IRBorisov 2024-05-09 15:32:36 +03:00
parent 03fd5d054b
commit ea6bf7224c
2 changed files with 6 additions and 5 deletions

View File

@ -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;
}

View File

@ -49,7 +49,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) {
}
}
function handleTableKey(event: React.KeyboardEvent<HTMLDivElement>) {
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
if (!controller.isContentEditable || controller.isProcessing) {
return;
}
@ -97,7 +97,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) {
return (
<>
{controller.isContentEditable ? <RSListToolbar /> : null}
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleTableKey}>
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleKeyDown}>
{controller.isContentEditable ? (
<SelectedCounter
totalCount={controller.schema?.stats?.count_all ?? 0}