From 5c07afe4ff869875252a1481291ab705b838537a Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 16 Jul 2024 17:27:43 +0000 Subject: [PATCH] web/updates: keyboard navigation --- web/src/routes/updates/+page.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/routes/updates/+page.svelte b/web/src/routes/updates/+page.svelte index d2dd5496..98125a9b 100644 --- a/web/src/routes/updates/+page.svelte +++ b/web/src/routes/updates/+page.svelte @@ -52,6 +52,11 @@ changelogs[next]().catch(() => {}); } + const handleKeydown = (e: KeyboardEvent) => { + if (e.key === 'ArrowLeft') loadPrev(); + else if (e.key === 'ArrowRight') loadNext(); + } + $: prev = versions[currentIndex - 1]; $: next = versions[currentIndex + 1]; $: currentIndex, loadChangelog(); @@ -112,6 +117,8 @@ + +
{#if changelog}
@@ -150,4 +157,4 @@
{/if} -
\ No newline at end of file +