Selaa lähdekoodia

revert: fix mobile scroll

Yifei Zhang 1 vuosi sitten
vanhempi
commit
e2c1475857
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      app/components/chat.tsx

+ 5 - 1
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 (
     <div className={styles.chat} key={session.id}>
       <div className={styles["window-header"]}>