[BUG] useElementScroll function is not working.
1. Read the FAQs 👇 ✔︎
2. Describe the bug
useElementScroll function is not working as expected in version v1.11.1
If I try tu use useElementScroll method on a section of my web, the MotionValue result is not changing.
Is working fine with useViewportScroll, i think that useElementScroll is similar but with a ref element, i'm ok? or I misunderstand the function?
3. IMPORTANT: Provide a CodeSandbox reproduction of the bug
CodeSandbox (is the useViewporScroll example, converted to useElementScroll example) https://codesandbox.io/s/scroll-r31k1?file=/src/Example.tsx
4. Steps to reproduce
Steps to reproduce the behavior:
- Go to CodeSandbox
- Open devtool to wath the change on the doms elements motion.div
- Scroll down to end of example
- See that the styles of motion.div's are not changing
5. Expected behavior Update values when the provided element scrolls:
Maybe I am misinterpreting how it is used, if so please excuse the "bug" but I need to know how to implement it correctly.
Me too
Having the same issue, but it looks like you need to have an element with overflow: Example
useElementScroll expects a scrollable element. I'll clarify in the docs.
Does it work when only overflow-x set to scroll? Overflow-y is hidden