-
-
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
AutocompleteInput throws an error if resource[optionText] isn't a string #2991
Comments
I don't understand this.
Why are you referring the filter ? |
This is the code I'm using to get around the error
In the autocomplete, for the optionText prop, if I just gave Because it is trying to run |
We surely can improve this error message, but we'll not be able to do much. |
Yes I agree, some missing data should not crash the app. |
I think the fix is as easy as adding an empty string ( react-admin/packages/ra-ui-materialui/src/input/AutocompleteInput.js Lines 176 to 189 in af8f2da
|
IMO it's a better idea to filter the erroneous results and display an error in the console. @developerium It's up to you! PR are welcome :) |
@fzaninotto I agree, will you put this in your next release or should I make a pull request? since it's a minor change? |
you can make a pull request against master for that. |
Hi guys
I noticed in here, if the result field from api response is null, (usually when first input is put in page), then
suggestionLabel.toString()
will throw an error saying null doesn't have methodtoString
.What do you think about this? Should we put a default filter to avoid being null, or convert to string differently?
The text was updated successfully, but these errors were encountered: