Skip to content

Commit

Permalink
Enabled keyboard arrow navigation in the folder selection
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Feb 8, 2024
1 parent 85c4eb1 commit 9fdfdc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/frontend/FolderSelection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
}
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Needed because SMUI doesn't provide types for the event
function handleItemKeydown(e: any, item: NamedRecord): void {
if ((e as KeyboardEvent).key === "ArrowRight") {
itemNavigation(item);
}
}
getItems();
</script>

Expand Down Expand Up @@ -127,6 +134,9 @@
on:dblclick={() => {
itemNavigation(item);
}}
on:keydown={(e) => {
handleItemKeydown(e, item);
}}
on:SMUI:action={() => {
if (selected === item) {
itemNavigation(item);
Expand Down

0 comments on commit 9fdfdc1

Please sign in to comment.