From fb14785cadf2055818bd4ff9c6064b59e53c2700 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Sat, 15 Apr 2023 02:28:30 +0800 Subject: [PATCH] fix: #804 disable auto scroll in textarea --- app/components/chat.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index b9ae1392..b0deb5a5 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -442,16 +442,6 @@ export function Chat(props: { inputRef.current?.focus(); }; - const scrollInput = () => { - const dom = inputRef.current; - if (!dom) return; - const paddingBottomNum: number = parseInt( - window.getComputedStyle(dom).paddingBottom, - 10, - ); - dom.scrollTop = dom.scrollHeight - dom.offsetHeight + paddingBottomNum; - }; - // auto grow input const [inputRows, setInputRows] = useState(2); const measure = useDebouncedCallback( @@ -476,7 +466,6 @@ export function Chat(props: { // only search prompts when user input is short const SEARCH_TEXT_LIMIT = 30; const onInput = (text: string) => { - scrollInput(); setUserInput(text); const n = text.trim().length;