Skip to content

Commit

Permalink
fix(BackToTop): May bounces multiple times when get to bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
ZL-Asica committed Nov 12, 2024
1 parent 387af09 commit c25165b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/common/BackToTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function BackToTop() {
// Check if at bottom
if (
window.innerHeight + window.scrollY >=
document.documentElement.scrollHeight
document.documentElement.scrollHeight - 10 &&
!isAtBottom
) {
setIsAtBottom(true);
// Add 500ms animation delay
Expand Down

0 comments on commit c25165b

Please sign in to comment.