瀏覽代碼

fix: improve scroll

Yifei Zhang 2 年之前
父節點
當前提交
56ba8a65e0
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/components/chat.tsx

+ 2 - 2
app/components/chat.tsx

@@ -461,9 +461,9 @@ export function Chat(props: {
 
   // Auto focus
   useEffect(() => {
-    if (props.sideBarShowing) return;
+    if (props.sideBarShowing && isMobileScreen()) return;
     inputRef.current?.focus();
-  }, [props.sideBarShowing]);
+  }, []);
 
   return (
     <div className={styles.chat} key={session.id}>