feat: add comment keybind navigation

This commit is contained in:
James Xylight committed 2025-08-07 21:21:23 -07:00
1 parent 0ca8f7474e
commit 7e2e7c513c
10 files changed
+152 -52

No files matched your search

@@ -25,6 +25,7 @@
import CommentForm from './CommentForm.svelte'
import type { CommentNodeI } from './comments.svelte'
import { page } from '$app/state'
import { keybindComment } from '$lib/ui/keybinds.svelte'
interface Props {
node: CommentNodeI
@@ -117,9 +118,15 @@
</Modal>
{/if}
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
<li
class={['py-3 relative', clazz]}
class={['py-3 relative focus:outline-0', clazz]}
id={node.comment_view.comment.id.toString()}
data-type="comment"
onkeydown={e =>
keybindComment(e, node.comment_view.comment.id, () => (open = !open))}
tabindex="0"
>
{#if meta}
<button