diff --git a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte index ec04a8e7..15c7acdd 100644 --- a/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte +++ b/src/lib/components/lemmy/comment/CommentListVirtualizer.svelte @@ -16,11 +16,13 @@ let { nodes, post, scrollTo }: Props = $props() + let nodesState = $state(nodes) + let virtualListEl = $state() let virtualizer = $derived( createWindowVirtualizer({ - count: nodes.length, + count: nodesState.length, estimateSize: () => 30, scrollMargin: virtualListEl?.offsetTop, initialRect: { @@ -71,7 +73,7 @@ data-index={row.index} class="-mx-4 sm:-mx-6 px-4 sm:px-6" > - + {/each} diff --git a/src/lib/components/lemmy/comment/CommentVote.svelte b/src/lib/components/lemmy/comment/CommentVote.svelte index 600c07d6..42d8451d 100644 --- a/src/lib/components/lemmy/comment/CommentVote.svelte +++ b/src/lib/components/lemmy/comment/CommentVote.svelte @@ -48,7 +48,7 @@
{/if} - {#if comments} - {@const tree = buildCommentsTree( + @@ -502,13 +503,8 @@ (settings.hidePosts.removed && c.comment.removed) ), )} - - - {/if} + scrollTo={data.thread.focus} + /> {#if comments.comments.length == 0}