Skip to content

[Autocomplete] Add note in JSDoc for non-TextField components in renderInput #46141

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

Merged
merged 3 commits into from
May 14, 2025

Conversation

khllbnomrn
Copy link
Contributor

@khllbnomrn khllbnomrn commented May 13, 2025

This PR improves the documentation of the Autocomplete component by adding a warning to the renderInput prop's JSDoc. It clarifies that developers should not return non-TextField components (e.g. DatePicker, Select) directly inside renderInput. issue mui/mui-x#17832

I have followed (at least) the PR section of the contributing guide.

Preview: https://deploy-preview-46141--material-ui.netlify.app/material-ui/api/autocomplete/#autocomplete-prop-renderInput

This addition provides a clear warning to developers about the limitations of the renderInput prop, helping them avoid common pitfalls.

Signed-off-by: khllbnomrn <[email protected]>
@khllbnomrn khllbnomrn changed the title docs(Autocomplete): add warning about using non-TextField components in renderInput [docs] Autocomplete: add warning about using non-TextField components in renderInput May 13, 2025
@ZeeshanTamboli ZeeshanTamboli added component: autocomplete This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature labels May 14, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [docs] Autocomplete: add warning about using non-TextField components in renderInput [Autocomplete] Add warning about using non-TextField components in renderInput May 14, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [Autocomplete] Add warning about using non-TextField components in renderInput [Autocomplete] Add note in JSDoc about using non-TextField components in renderInput May 14, 2025
@zannager zannager requested a review from DiegoAndai May 14, 2025 08:17
@mui-bot
Copy link

mui-bot commented May 14, 2025

Netlify deploy preview

https://deploy-preview-46141--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 83c0a0c

@ZeeshanTamboli ZeeshanTamboli changed the title [Autocomplete] Add note in JSDoc about using non-TextField components in renderInput [Autocomplete] Add note in JSDoc when using non-TextField components in renderInput May 14, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [Autocomplete] Add note in JSDoc when using non-TextField components in renderInput [Autocomplete] Add note in JSDoc for non-TextField components in renderInput May 14, 2025
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khllbnomrn I made some changes in the wording. Thanks for the PR!

@ZeeshanTamboli ZeeshanTamboli merged commit 5035d5f into mui:master May 14, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants