Skip to content

Commit

Permalink
fix: calculate scroll and client hight
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 20, 2024
1 parent ab3f792 commit e6d6433
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ const ChatBody = memo(
isUserManuallyScrollingUp.current = false
}

const scrollHeight = event.currentTarget.scrollHeight
const clientHeight = event.currentTarget.clientHeight

if (currentScrollTop + clientHeight >= scrollHeight) {
isUserManuallyScrollingUp.current = false
}

if (isUserManuallyScrollingUp.current === true) {
event.preventDefault()
event.stopPropagation()
Expand Down

0 comments on commit e6d6433

Please sign in to comment.