소스 검색

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}>