[data grid] scrollToIndexes
with lazyloading
#15810
Labels
component: data grid
This is the name of the generic UI component, not the React module!
customization: logic
Logic customizability
status: waiting for author
Issue with insufficient information
support: commercial
Support request from paid users
support: pro standard
Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
I created an example application based on the lazy loading documentation example here:
https://codesandbox.io/p/sandbox/confident-benji-37qqyl?file=%2Fsrc%2FDemo.js
After the first couple of datagrid entries are loaded from the server we want to use scrollToIndexes() to navigate to a specific rowIndex. We tried using apiRef.current.scrollToIndexes() with a timeout in a useEffect which does work but we want to directly react to the rows being loaded and navigate afterwards.
The navigation itself does work when using onStateChange but once the focus is reset (e.g. by scrolling using the scrollbar) the grid scrolls back to the previously used coordinates.
tldr; We want to scroll with lazyloading and refrain from using timeouts and the scroll is supposed to happen only once in the beginning.
Also, I saw a similar issue here #15179 but we don't want to use timeouts as a solution.
Your environment
`npx @mui/envinfo`
Search keywords: scrollToIndexes, lazyLoading
Order ID: 102538
The text was updated successfully, but these errors were encountered: