Skip to content

Commit

Permalink
Reduce distance from bottom to trigger auto scroll to 50 pixels
Browse files Browse the repository at this point in the history
This should ease scrolling up to disable auto scroll when Khoj
response being streamed
  • Loading branch information
debanjum committed Sep 29, 2024
1 parent 425b421 commit d401860
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function ChatHistory(props: ChatHistoryProps) {

const detectIsNearBottom = () => {
const { scrollTop, scrollHeight, clientHeight } = scrollAreaEl;
const bottomThreshold = 100; // pixels from bottom
const bottomThreshold = 50; // pixels from bottom
const distanceFromBottom = scrollHeight - (scrollTop + clientHeight);
const isNearBottom = distanceFromBottom <= bottomThreshold;
setIsNearBottom(isNearBottom);
Expand Down

0 comments on commit d401860

Please sign in to comment.