From bf292068f429e9c027789608a4a48c13fb1f2552 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sun, 8 Oct 2023 16:43:57 +0100 Subject: [PATCH] CLASSROOMIO-T-214: scroll to bottom on add and wrap text --- .../Apps/components/Comments/index.svelte | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib/components/Apps/components/Comments/index.svelte b/src/lib/components/Apps/components/Comments/index.svelte index 2abc02a1..ab5d3e90 100644 --- a/src/lib/components/Apps/components/Comments/index.svelte +++ b/src/lib/components/Apps/components/Comments/index.svelte @@ -50,11 +50,6 @@ }); comment = ''; - setTimeout(() => { - bodyRef.scrollTo({ - top: bodyRef.scrollHeight - }); - }, 100); } function handleKeyDown(e: KeyboardEvent) { @@ -98,6 +93,11 @@ } ]; $lesson.totalComments = comments.length; + setTimeout(() => { + bodyRef.scrollTo({ + top: bodyRef.scrollHeight + }); + }, 100); } async function fetchComments(people: GroupPerson[], lessonId?: string | null) { @@ -139,7 +139,6 @@ : lessonComment.groupmember.profile.fullname }; }); - // $lesson.totalComments = comments.length; } onMount(async () => { @@ -166,7 +165,7 @@ -
+
{#each comments as comment}
@@ -184,7 +183,7 @@

-
+
{comment.comment}