Compare commits

...
Author SHA1 Message Date
Cursor Agent 6d56621512 Fix keyboard scroll-up failing to disable auto-scroll
Add a catch-all branch in onMessagesScroll that detects upward scrolling
from keyboard, assistive technology, or any other scroll source not
covered by the explicit wheel/pointer/touch intent flags. Without this,
pressing Page Up, Home, or Arrow Up would not disable auto-scroll,
causing the view to snap back to the bottom on the next message update.
2026-02-20 00:32:34 +00:00
+6
View File
@@ -1140,6 +1140,12 @@ export default function ChatView({ threadId }: ChatViewProps) {
if (scrolledUp) {
shouldAutoScrollRef.current = false;
}
} else if (shouldAutoScrollRef.current && !atBottom) {
// Catch-all for keyboard, assistive technology, or any other scroll source.
const scrolledUp = currentScrollTop < lastKnownScrollTopRef.current - 1;
if (scrolledUp) {
shouldAutoScrollRef.current = false;
}
}
lastKnownScrollTopRef.current = currentScrollTop;