file item navigation with arrows

This commit is contained in:
vcoppe
2024-06-19 18:51:26 +02:00
parent 06bc49901d
commit 4f42ee20e4
2 changed files with 102 additions and 5 deletions

View File

@@ -35,7 +35,8 @@
triggerFileInput,
createFile,
loadFiles,
toggleSelectionVisibility
toggleSelectionVisibility,
updateSelectionFromKey
} from '$lib/stores';
import { selectAll, selection } from '$lib/components/file-list/Selection';
import { derived } from 'svelte/store';
@@ -353,6 +354,14 @@
} else if (e.key === 'F4') {
$directionMarkers = !$directionMarkers;
e.preventDefault();
} else if (
e.key === 'ArrowRight' ||
e.key === 'ArrowDown' ||
e.key === 'ArrowLeft' ||
e.key === 'ArrowUp'
) {
updateSelectionFromKey(e.key === 'ArrowRight' || e.key === 'ArrowDown', e.shiftKey);
e.preventDefault();
}
}}
on:dragover={(e) => e.preventDefault()}