0

window.addEventListener('touchmove', handleScrollMobile)
        return () => window.removeEventListener('touchmove', handleScrollMobile)
        
        
function handleScrollMobile() {
        if (window.innerHeight + document.documentElement.scrollTop !== document.documentElement.offsetHeight || isFetching) return
        setIsFetching(true)
    }

this code works fine on desktop chrome mobile view but its not working on my android phone. the code sets 'setIsFetching' to true every time the user reaches the bottom of the page.

abood alwa7sh
  • 63
  • 1
  • 11
  • Whats up with the "return" after calling "addEventListener"? – Krisztián Balla Jul 25 '21 at 09:58
  • did you review this? https://stackoverflow.com/questions/9880472/determine-distance-from-the-top-of-a-div-to-top-of-window-with-javascript/9880571 –  Jul 25 '21 at 09:59

0 Answers0