Scrolling inside different containers
See original GitHub issueRight now React-Scroll-To only supports scrolling on the window, but there are use-cases where a user might want to scroll inside different containers (say a div).
Proposed Idea:
Add a new prop to <ScrollTo> to accept a ‘scrolling location’. This would look like:
<ScrollTo container={divRef}>
{scroll => ... }
</ScrollTo>
Where the container could be a Ref passed in. If nothing is given in the container prop, default to using window.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:11 (9 by maintainers)
Top Results From Across the Web
CSS: how to get scrollbars for div inside container of fixed height
Is there a way to have a short height and hide the scroll-bar at the same time? this way when users drag down...
Read more >Scroll container - MDN Web Docs Glossary
The scroll container allows the user to scroll through parts of the overflow region that would otherwise be clipped and hidden from view....
Read more >How To Create Horizontal Scrolling Containers - codeburst
Let's first create our container and our children divs inside of it that will scroll horizontally. The HTML is pretty simple. <div class="scrolling-wrapper">...
Read more >Creating a Nested Scroll Using Containers | ProtoPie Blog
Learn how to create a horizontal and a vertical scroll for your prototype by using containers in ProtoPie.
Read more >Creating horizontal scrolling containers the right way [CSS Grid]
The scrolling container Using grid-template-columns we can set up how much space we want each card should take up — in this example,...
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 Free
Top 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

@newyork-anthonyng My wording was off, I was thinking of it more like reusable functions instead of an actual class hierarchy. But thinking about it more, it would require a single global instance of a
ScrollAreaarray.I’m in favor of option 1 due to a single global object sounding like a bad idea. Option 1 would better encapsulate the
ScrollAreaarray into each instance ofScrollToandScrollToHOC. Playing around with the idea, here’s an example of option 1.@newyork-anthonyng No problem, always good to have a second pair of eyes on things. I’ll get a PR made up, and close this issue out! 😄