소스 검색

Merge pull request #415 from RugerMcCarthy/opt/back_to_autoscroll

opt: back to autoscroll when hit bottom
Yifei Zhang 1 년 전
부모
커밋
a4743034a9
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/components/chat.tsx

+ 1 - 1
app/components/chat.tsx

@@ -528,7 +528,7 @@ export function Chat(props: {
         className={styles["chat-body"]}
         ref={scrollRef}
         onScroll={(e) => onChatBodyScroll(e.currentTarget)}
-        onWheel={() => setAutoScroll(false)}
+        onWheel={(e) => setAutoScroll(hitBottom && e.deltaY > 0)}
         onTouchStart={() => {
           inputRef.current?.blur();
           setAutoScroll(false);