Skip to content
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

options prop isn't supported for SelectInput but yet Included in the Docs - https://marmelab.com/react-admin/doc/4.14/SelectInput.html#options #9352

Closed
johnkingzy opened this issue Oct 11, 2023 · 3 comments · Fixed by #9379

Comments

@johnkingzy
Copy link

johnkingzy commented Oct 11, 2023

What you were expecting:
I was hoping for more clarity in the component documentation; it appears to be a bit ambiguous at times.

What happened instead:
The doc here says the SelectInput props supports an options props and it also mentioned that it uses Material UI Select under the hood but from looking at the source code here, it uses ResettableTextField which uses TextField under hood.

Steps to reproduce:
From the docs, it says you can pass in an options props but trying to do that throws a TS error because that isn't supported.

Related code:
https://marmelab.com/react-admin/doc/4.14/SelectInput.html#options

<SelectInput source="category" choices={choices} options={{ maxHeight: 200 }} />

Other information:

Environment

  • React-admin version: 4.14.5 (latest at the time of submitting this)
  • Last version that did not exhibit the issue (if applicable):
  • React version: 18.2.0
  • Browser: Chrome
  • Stack trace (in case of a JS error):
@slax57
Copy link
Contributor

slax57 commented Oct 12, 2023

Thanks for the report!
Indeed, it looks to me that this prop is not supported at all, neither by RA nor MUI.
I think we should simply remove it from the docs.
@fzaninotto @djhi do you share this analysis?

@djhi
Copy link
Collaborator

djhi commented Oct 12, 2023

Yes, this is something we had in v3

@slax57
Copy link
Contributor

slax57 commented Oct 12, 2023

@johnkingzy Would you like to open a PR to fix the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants