Jelajahi Sumber

fix tos scrolling bug (#992)

eldiegod 3 tahun lalu
induk
melakukan
e6727b0c28
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      src/components/SignInSteps/TermsStep.tsx

+ 2 - 1
src/components/SignInSteps/TermsStep.tsx

@@ -23,12 +23,13 @@ export const TermsStep: React.FC = () => {
     const scrollHeight = termsBoxRef.current.scrollHeight
     const boxHeight = termsBoxRef.current.clientHeight
 
-    if (scrollPosition === scrollHeight - boxHeight) {
+    if (scrollPosition >= (scrollHeight - boxHeight) * 0.95) {
       setHasScrolledToBottom(true)
     }
   }, [scrollPosition])
 
   const handleScrollToBottom = () => {
+    setHasScrolledToBottom(true)
     if (!termsBoxRef?.current) return
     termsBoxRef?.current?.scrollTo(0, termsBoxRef.current.scrollHeight)
   }