eldiegod 3 лет назад
Родитель
Сommit
e6727b0c28
1 измененных файлов с 2 добавлено и 1 удалено
  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)
   }