From 3df8f0b00a94f3b1bade56acbb9e0094fb109ea4 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 8 Nov 2024 14:20:55 +0700 Subject: [PATCH] fix: correct chat input cursor behavior when content is scrollable --- .../Thread/ThreadCenterPanel/ChatInput/RichTextEditor.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/screens/Thread/ThreadCenterPanel/ChatInput/RichTextEditor.tsx b/web/screens/Thread/ThreadCenterPanel/ChatInput/RichTextEditor.tsx index 096ef51e02..bca808e289 100644 --- a/web/screens/Thread/ThreadCenterPanel/ChatInput/RichTextEditor.tsx +++ b/web/screens/Thread/ThreadCenterPanel/ChatInput/RichTextEditor.tsx @@ -269,6 +269,10 @@ const RichTextEditor = ({ ? '100px' : '40px' textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px' + textareaRef.current?.scrollTo({ + top: textareaRef.current.scrollHeight, + behavior: 'instant', + }) textareaRef.current.style.overflow = textareaRef.current.clientHeight >= 390 ? 'auto' : 'hidden' }