react-virtualized: Do you have any plans for making a two-way infinitely scrollable view?
There are several things I’d like to make infinitely scrollable:
- Calendars
- Lists of documents sorted by date
In both of these cases I want to be able to scroll as far into the past or future as possible, but since <Grid> isn’t really designed to scroll up above row 0, it would take some kind of hacks to enable that.
For use cases like this, I think it’s probably better for the scroll container to wrap around when it reaches the bottom or top, but maintain a “virtual” scroll position. Then the scroll container could pass its virtual scroll bounds (top/bottom/left/right) to a function I provide that decides what to render for those bounds.
But maybe that should just be a separate package…what do you think?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (20 by maintainers)
@jedwards1211 For what it’s worth, you could check out what the Angular Material team came up with for inspiration, sounds quite similar to what you’re describing. If I recall correctly, it works by listening to mousewheel events and translating a container with
translate3d, and can “scroll” infinitely in both directions. Check out this infinite scrolling datepicker for reference: https://material.angularjs.org/1.1.2/demo/datepickerIt doesn’t feel quite as perfect as native scrolling, but it’s pretty close. The differences are mostly noticeable when scrolling really fast.
@clauderic ah I see, yeah, that’s a good point that it’s usually no problem to restrict the min date. Well it’s certainly possible to add a way to jump to a given year and month without sacrificing the infinite scrolling in a datepicker. My initial inspiration for this came from the macOS calendar, which I think is pretty nice. (Interestingly, it treats slow scrolling and fast flicks as separate gestures, for the latter it aligns to the prev/next month.)
@clauderic you didn’t even shill your own
react-infinite-calendar? Looks awesome! Don’t be so humble 😉Oh, that sucks…
I got a basic two-way vertical infinite scroll wrapper for
Gridworking in Chrome! Notably, I had to call theGrid’s_resetStyleCachewhenever scrolling wraps around to make the cells render the proper contents before scrolling stops.Here’s the code: