question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing of scroll container to useGridList

See original GitHub issue

🙋 Feature Request

The new useGridList feature uses useSelectableList which does not allow for passing a scroll container via scrollRef (like the Table component does). This assumes the scroll container is always the list view itself, which is not always the case. This request is to add the capability for passing a scrollRef prop into useGridList.

🤔 Expected Behavior

By providing a scrollable container, the GridList will be able to use a non-fixed height and still scroll list elements into view. See context below.

😯 Current Behavior

Scrolling items into view is only possible when the list itself is scrollable.

💁 Possible Solution

useSelectableList could allow for a scrollRef prop instead of assuming it’s the list ref itself

🔦 Context

My use case is to provide multiple lists on the page with non-fixed heights. If the list exceeds the body of the page, the body itself would act as the scroll container and scroll list items into view.

Code sample

https://stackblitz.com/edit/react-spectrum-3489?file=src/App.js

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LFDanLucommented, Sep 13, 2022

Seems reasonable to me, will bring this to the team during our next grooming.

0reactions
LFDanLucommented, Sep 22, 2022

As an aside, this issue is related to https://github.com/adobe/react-spectrum/issues/2766 (note: that issue isn’t actually virtualizer specific), we’ll be looking to resolve this class of issue as our next upcoming milestone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

useGridList – React Aria - React Spectrum Libraries
Keyboard navigation – List items and focusable children can be navigated using the arrow keys, along with page up/down, home/end, etc. Typeahead, auto...
Read more >
Scroll back to the top of scrollable div - Stack Overflow
When a variableLongtext is loaded in the container div and am looking at the middle of it, then swipe to the new variableLongtext,...
Read more >
Overflowing content - Learn web development | MDN
Overflow happens when there is too much content to fit in a box. ... x and y scrolling using the overflow property, passing...
Read more >
How to use the ScrollContainer component (Starling version)
We can give the ScrollContainer a background skin that stretches to fill the entire width and height of the scroll container. In the...
Read more >
Lists and grids | Jetpack Compose - Android Developers
LazyColumn produces a vertically scrolling list, and LazyRow produces a horizontally ... The lazy components allow you to pass some PaddingValues to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found