[FEATURE] use closest scroll container in useViewportScroll
See original GitHub issueIs your feature request related to a problem? Please describe.
useViewportScroll
only works with the body
element.
Describe the solution you’d like
I’d like if useViewportScroll
could optionally accept a ref to an element and use the closest scroll container.
Describe alternatives you’ve considered I noticed that the docs suggest rolling this yourself, but I think it could be helpful to provide out of the box.
I’d be happy to submit a PR with this functionality, please let me know 😊.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
javascript - Find first scrollable parent - Stack Overflow
This method finds the nearest ancestor that allows scrolling. In other words, the .scrollParent() method finds the element that the currently selected element ......
Read more >How to Create a Scroll Progress Animation with Framer ...
For our use case, we will be utilizing the scrollYProgress value that is returned since we want to track the progress between 0...
Read more >Accessibility | Framer for Developers
In this guide, we'll learn how to use the reducedMotion option and ... which will update's a motion component's y position as the...
Read more >Framer Motion Tutorials: Make More Advanced Animations
Framer Motion lets you use the same animation library both in prototyping ... ParallaxBox component animation is set in motion by scrolling, ...
Read more >Get the first scrollable parent of an element - HTML DOM
For each parent node, we check if it is a scrollable node. const isScrollable = function (ele) { const hasScrollableContent = ele.scrollHeight >...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve also ended up needing this feature. If help is needed with the PR I’m happy to chip in.
Is anything happening with this, really need this