fix: enhance autoscroll logic to consider messages and suggested questions
This commit is contained in:
parent
83c0805074
commit
32f0b17597
@ -2033,7 +2033,7 @@ The new Anthropic models: Claude 3.5 Sonnet and 3.5 Haiku models are now availab
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
const userScrolled = window.innerHeight + window.scrollY < document.body.offsetHeight;
|
const userScrolled = window.innerHeight + window.scrollY < document.body.offsetHeight;
|
||||||
if (!userScrolled && bottomRef.current) {
|
if (!userScrolled && bottomRef.current && (messages.length > 0 || suggestedQuestions.length > 0)) {
|
||||||
bottomRef.current.scrollIntoView({ behavior: "smooth" });
|
bottomRef.current.scrollIntoView({ behavior: "smooth" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user