-
-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error occurs when data is empty, isLoading is true and a filter for a nested field is set #225
Comments
The following changes in MRT_TableRoot.tsx fix the problem. (I haven't yet figured out all the types and there is probably a more elegant way to achieve this.) However there is still the separate problem that the filter gets rid of all the skeleton rows and therefore of the loading animation (this has nothing to do with object nesting).
using:
|
I'm having the problem with the skeleton when using filters, any solution to this? |
I don't think so. We should probably open a separate issue for that. But the workaround also kind of works. Just set the filters only when the loading is done. |
Yeah, I was going to suggest enableFiltering could be false when isLoading is true |
I tried putting the enableFilters to true only when the loading is done, but the problem seems to be related with the initialState, where I set the columnFilters that I get from the queryString as a initial filter value, when I don't have a queryString, the columnFilters on the initialState is an empty array and there is no problem with the skeleton, when I get to the page through a URL containing a queryString the columnFilters is not empty and the skeleton don't load, it appears a message "No results found" and the progress bar. |
I opened an issue for this secondary problem: #237 |
material-react-table version
1.3.16
react & react-dom versions
18.0.20
Describe the bug and the steps to reproduce it
This error only seems to occur when three conditions are met:
In a real app this would happen if I need to wait for a server request to return before filling in the data.
Workaround: Only set filters when data arrives (Won't work if the server doesn't return any rows).
Minimal, Reproducible Example - (Optional, but Recommended)
https://stackblitz.com/edit/github-2hvpac?file=src/TS.tsx
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms
The text was updated successfully, but these errors were encountered: