From ebad6c3e937257ec79f838b421db37382aeff485 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 8 Nov 2024 16:32:42 +0700 Subject: [PATCH] fix: correct chat input cursor behavior when content is scrollable (#3979) --- .../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 096ef51e0..bca808e28 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' }