-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
emptyText prop on ArrayField has no effect. #6179
Comments
Indeed, it hasn't been implemented for ArrayField. Thanks for the report! |
I think So I'm transforming this into a documentation issue: in the list of common field props, it should be mentioned that emptyText doesn't concern ArrayField and the likes. |
Thanks for bringing that prop to my attention, I upgraded my version and see it now. It doesn't solve this issue though, consider this code:
So in our case Which is why I would argue having an Let me know what you think. Edit: Or maybe this is a bug and DataGrid should be checking for null / undefined? |
@fzaninotto Any thoughts on the above? |
ArrayField should always put an array of ids in the ListContext. If Datagrid receives a null value for ids, then it may be a bug. Can you build a CodeSandbox to reproduce the issue? |
I probably won't get to that for a while, so if you have an easily accessible API that you can test against that's probably going to be faster. |
@fzaninotto (Sorry to tag, just in case you only get notifications when tagged) I got to this sooner than I thought, here's a recreation: https://github.com/martdavidson/6179-recreation Check that out, run |
@martdavidson Thanks, I managed to reproduce the issue with ArrayField, I'll open a PR to fix it. |
The documentation problem remains: we should explicitly say that emptyText doesn't work on array fields. |
What you were expecting:
Expected emptyText to be output from an ArrayField when there are no items in that array.
What happened instead:
Instead, we get an empty
<DataGrid>
(or I assume whatever child) with the table headers, and no data.Steps to reproduce:
Can do something like:
And the result is:
Instead of the empty text.
Environment
The text was updated successfully, but these errors were encountered: