From e2c1475857843c65d803b67292a8f14adffe49d8 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Sun, 2 Apr 2023 19:24:29 +0000 Subject: [PATCH] revert: fix mobile scroll --- app/components/chat.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index f1ea597d..3864a329 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -286,7 +286,6 @@ function useScrollToBottom() { const dom = scrollRef.current; if (dom && autoScroll) { setTimeout(() => (dom.scrollTop = dom.scrollHeight), 1); - setAutoScroll(false); } }); @@ -460,6 +459,11 @@ export function Chat(props: { const [showPromptModal, setShowPromptModal] = useState(false); + // Auto focus + useEffect(() => { + inputRef.current?.focus(); + }, []); + return (