From 1359783d6b8f9500d60e4f0f762842c1408646ef Mon Sep 17 00:00:00 2001 From: Evgenii Kozlov Date: Thu, 29 May 2025 10:50:32 +0200 Subject: [PATCH] DROID-3258 Chats | Fix | Should not scroll to bottom after editing a message (#2478) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt index 4eaffb7b45..a49374e98a 100644 --- a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt +++ b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/ChatBox.kt @@ -371,7 +371,11 @@ fun ChatBox( .clickable { onMessageSent(text.text, spans) clearText() - resetScroll() + // Bypass resetScroll in edit mode because editing a message does not require + // resetting the scroll position, unlike sending a new message. + if (mode !is ChatBoxMode.EditMessage) { + resetScroll() + } showMarkup = false } }