Resize column with enableRowVirtualization, when there is only 1 single row data, the resize cause that row disappear
quangkhuat1995 opened this issue · comments
mantine-react-table version
v1.3.4
react & react-dom versions
18.2.0
Describe the bug and the steps to reproduce it
First of all, I understand that the document has already mentioned to use virtual only when there are many data, like at least 50 rows. However, here is the use case that we have.
We have a table that render data from our server, the table has total 24 columns (not all visibility at once so we don't use virtual column) and can render pagination from 50-100-250-1000 rows per page. We have a form to create filters/search to build our API query for the table data. So most of the time we will have a lot of things and we use enableRowVirtualization.
Since we have many columns so we also use enableColumnResizing
.
But, if user searches for something that return only 1 item, for example exact full name. And then performs a resize column, that single row data will disappear. With more than 1 item (eg: 2), everything works fine.
I can replicate that with the code sandbox from document page.
Minimal, Reproducible Example - (Optional, but Recommended)
This is the sandbox from this document
Please change these to replicate the issue:
- Add
enableColumnResizing: true,
touseMantineReactTable
- Change
setData(makeData(10_000));
tosetData(makeData(1));
// to replicate only 1 item response - Resize a column, you will see the data disappear. Sometimes, it will appear again.
Repeat again, but now with setData(makeData(2))
, you won't see error anymore.
Screenshots or Videos (Optional)
![image](https://private-user-images.githubusercontent.com/61539979/348324162-c5f4b654-6ce2-4ef1-9b32-7fb52e5eb47f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0NjE0OTYsIm5iZiI6MTcyMjQ2MTE5NiwicGF0aCI6Ii82MTUzOTk3OS8zNDgzMjQxNjItYzVmNGI2NTQtNmNlMi00ZWYxLTliMzItN2ZiNTJlNWViNDdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDIxMjYzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyNjIwOTBkNTE2ZTI4ZGJlOWRiNmU5YTBhNTQxODY1MTg5Zjk5MWRlZTkxNjhmMGYyY2UyODIzODZmZmEzMTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mzoO1B6CsyxrXmSCcCfDXsc_KIQDGECWEjCewtjcyeM)
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
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.