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.

Add scrollToIndex support for WindowScroller

See original GitHub issue

I has been reported that Grid does not support the scrollToIndex property when used with WindowScroller. Let’s investigate if it is possible to add support for this use case.

cc @tiberiumaxim: If you have questions, we can discuss them here or on Gitter.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bvaughncommented, Jan 17, 2017

Well, the problem you’ll have to solve in order to implement this feature basically boils down to this:

Normally a user scrolls within a Grid; Grid listens to scroll events and updates what it displays. When a user sets a prop like scrollToIndex- Grid determines what the offset of that row would be and updates the scroll position so that it’s visible.

WindowScroller changes the rules a bit. Its purpose is to enable a page to scroll outside of Grid so that other page elements can scroll too. It listens to scroll events and tells Grid which offset it should display visible data at.

The problem is this: WindowScroller is listening to the window object for scroll events. When you set a scrollToIndex prop, Grid updates its own scroll offset (and then renders new rows). WindowScroller isn’t listening to Grid and so the page isn’t scrolled to show the newly rendered rows.

I haven’t thought much about this problem because, as I mentioned previously, I don’t use WindowScroller. 😄

0reactions
bvaughncommented, Mar 15, 2017

Unfortunately I don’t have time to really dig into or think about this at the moment. I’d welcome a contribution if you’d like to dig into it and submit a PR, but I don’t have the bandwidth to offer any architectural guidance on it. Sorry!

Read more comments on GitHub >

github_iconTop Results From Across the Web

scrollToIndex doesn't work with WindowScroller - Stack Overflow
Does scrollToIndex works with WindowScroller? because I only found ... Since version 9.8.0, WindowScroller supports scrollToIndex prop.
Read more >
Getting Started with React Virtuoso | React Virtuoso
Add the Component to your application. ... The Virtuoso components provide an imperative scrollToIndex method with an optional align that scrolls the ...
Read more >
React Native scrollToIndex - Dynamic size item scroll inside ...
In this video tutorial you will learn about React Native scrollToIndex and how to scroll to an item inside a FlatList, ListView, ScrollView, ......
Read more >
react-virtualized
Collection; Grid; List; Masonry; Table. ArrowKeyStepper; AutoSizer; CellMeasurer; ColumnSizer; InfiniteLoader; MultiGrid; ScrollSync; WindowScroller ...
Read more >
react-virtualized/CHANGELOG and react-virtualized Releases ...
WindowScroller supports scrollToIndex prop. ... Added prop-types dependency to avoid deprecation warnings for React 15.5+.
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