Replies: 1 comment 1 reply
-
| We have some work being discussed around Carousels which could position the scrollbar in the center at all times and allow for something like this. I may be misunderstanding, but do you actually need bi-directional infinite scroll? You're landing in the middle of a data-set, which kind of implies a known start or a bound on the scrolling to the front. In this case, would you be better served by a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bi-directional infinite loading for collection components
Hi team, and thanks for the great work on the
LoadMoreItemAPI that shipped last year — it's been a solid foundation to build on.I'm building a retail management application that has a few list views (order history, inventory audit logs, transaction feeds...) where users need to deep-link into the middle of a large dataset and scroll both forward and backward from that anchor point. Think of landing on a specific order and being able to page toward newer or older records without losing your place.
The data layer is already handled — TanStack Query v5's
useInfiniteQueryexposesfetchPreviousPage/hasPreviousPagesymmetrically alongside the forward equivalents. The missing piece is on the React Spectrum side.What I'm running into
LoadMoreItemcurrently only works at the bottom of the collection. There's no supported way to place a sentinel at the top to triggerfetchPreviousPagewhen the user scrolls up to it.useAsyncListis forward-only. There's noloadPrevious()method orprevCursorreturn field, so using the built-in async list helper alongside a bi-directional API requires stepping outside it entirely.What I'd love to see
The minimal surface area that would unlock this:
And for
useAsyncList:A small
'loadingPrevious'addition to theloadingStateunion would round it out.I understand this is a non-trivial addition and there may be design considerations I'm not seeing from the outside. Thanks for considering it!
Beta Was this translation helpful? Give feedback.
All reactions