I ran into an issue where my component was not updating when trying to use framer-motion for a parallax effect. After debugging framer-motion, I found that it was not updating the scrollYProgress value because "maxYOffset" was set to 0. This special parameter is derived by framer-motion, using the following calculation:
document.body.clientHeight - window.innerHeight
Weird, I thought. My document is definitely scrolling. When I checked document.body.scrollHeight
, it looked fine. But why was document.body.clientHeight
less than document.body.scrollHeight
, especially if scrolling is what I care about?