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
Hello, i'm using a table with enableRowVirtualization set to true, i have injected a rowVirtualizerInstanceRef to the table and i'm using the method rowVirtualizerInstanceRef.current?.scrollToIndex(rowIndex) the problem is it does the scroll but it doesn't scroll to the exact index, i tried several params for the scrollToIndex method but the result is always the same
Minimal, Reproducible Example - (Optional, but Recommended)
Do you intend to try to help solve this bug with your own PR?
None
Terms
I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
mantine-react-table version
2.0.0-beta.7
react & react-dom versions
18.2.0
Describe the bug and the steps to reproduce it
Hello, i'm using a table with
enableRowVirtualization
set to true, i have injected arowVirtualizerInstanceRef
to the table and i'm using the methodrowVirtualizerInstanceRef.current?.scrollToIndex(rowIndex)
the problem is it does the scroll but it doesn't scroll to the exact index, i tried several params for thescrollToIndex
method but the result is always the sameMinimal, Reproducible Example - (Optional, but Recommended)
const Component = (props) => {
const rowVirtualizerInstanceRef = useRef<MRT_RowVirtualizer>(null)
useEffect(() => {
if (props.expandedRowId) {
const rowIndex = props.data.findIndex(row => row.invariant === props.expandedRowId)
setExpanded({ [rowIndex]: true })
rowVirtualizerInstanceRef.current?.scrollToIndex(rowIndex)
}
}, [props.expandedRowId])
return (
<MantineProvider
defaultColorScheme={darkTheme ? 'dark' : 'light'}
forceColorScheme={darkTheme ? 'dark' : 'light'}>
<MantineReactTable
localization={MRT_Localization_FR}
columns={columns}
data={props.data}
layoutMode='grid'
enablePagination={false}
enableTopToolbar={true}
enableStickyHeader={true}
enableRowVirtualization={true}
rowVirtualizerInstanceRef={rowVirtualizerInstanceRef}
state={{
density: 'xs'
}}
mantineTableContainerProps={{
style: { height: '60vh' }
}}
/>
)
}
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms
The text was updated successfully, but these errors were encountered: