revert: fix mobile scroll

This commit is contained in:
Yifei Zhang 2023-04-02 19:24:29 +00:00
parent 8d34b0f454
commit e2c1475857

View File

@ -286,7 +286,6 @@ function useScrollToBottom() {
const dom = scrollRef.current; const dom = scrollRef.current;
if (dom && autoScroll) { if (dom && autoScroll) {
setTimeout(() => (dom.scrollTop = dom.scrollHeight), 1); setTimeout(() => (dom.scrollTop = dom.scrollHeight), 1);
setAutoScroll(false);
} }
}); });
@ -460,6 +459,11 @@ export function Chat(props: {
const [showPromptModal, setShowPromptModal] = useState(false); const [showPromptModal, setShowPromptModal] = useState(false);
// Auto focus
useEffect(() => {
inputRef.current?.focus();
}, []);
return ( return (
<div className={styles.chat} key={session.id}> <div className={styles.chat} key={session.id}>
<div className={styles["window-header"]}> <div className={styles["window-header"]}>