You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WindowScroller to allow scrolling to happen on the page (not within a container), and an onResize event handler to clear the CellMeasurerCache (for a responsive layout)
AutoSizer for calculating automatic an width (for a responsive layout)
List to display basic content in one column (an image and text on every row)
CellMeasurer with an <img />onLoad to calculate the dynamic height of each row (they will all be different depending on what image/text is on that row),
My reason for using react-virtualized is because the core of my site is an infinitely scrolling vertical list with large images, and the page will get very large very quickly if new elements were just appended to the bottom as you scrolled.
Issue
I am attempting to call the List public method scrollToRow() so when you click on a button (will eventually be a nav link), you're scrolled to a particular row on the page. However it doesn't appear to be working. (I'm very new to react-virtualized.)
I have created a button at the top of the List which has an onClick function which attempts to call the List public method scrollToRow() with an index value of 9 (the 10th row). Clicking the button does not scroll to row 10. No error is thrown.
No outside dependencies in my project.
What is the expected behavior?
I expect the List to scroll to row 10 when the button is clicked.
Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?
Device
MacBook Pro 16-inch, 2023, M2 Pro
Browser
Google Chrome Version 123.0.6312.58 (Official Build) (arm64)
OS
macOS Ventura 13.6.5 (22G621)
React
18.2.0
React DOM
18.2.0
react-virtualized
9.22.5
The text was updated successfully, but these errors were encountered:
Bug Report
Background
I'm using an implementation of
react-virtualized
with:WindowScroller
to allow scrolling to happen on the page (not within a container), and anonResize
event handler to clear theCellMeasurerCache
(for a responsive layout)AutoSizer
for calculating automatic an width (for a responsive layout)List
to display basic content in one column (an image and text on every row)CellMeasurer
with an<img />
onLoad
to calculate the dynamic height of each row (they will all be different depending on what image/text is on that row),My reason for using
react-virtualized
is because the core of my site is an infinitely scrolling vertical list with large images, and the page will get very large very quickly if new elements were just appended to the bottom as you scrolled.Issue
I am attempting to call the
List
public methodscrollToRow()
so when you click on a button (will eventually be a nav link), you're scrolled to a particular row on the page. However it doesn't appear to be working. (I'm very new toreact-virtualized
.)Code
CodeSandbox:
https://codesandbox.io/p/sandbox/photolist-react-virtualized-fzhtm9?file=%2Fsrc%2FApp.js
What is the current behavior?
I have created a button at the top of the
List
which has anonClick
function which attempts to call theList
public methodscrollToRow()
with an index value of9
(the 10th row). Clicking the button does not scroll to row 10. No error is thrown.No outside dependencies in my project.
What is the expected behavior?
I expect the
List
to scroll to row 10 when the button is clicked.Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?
The text was updated successfully, but these errors were encountered: