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

[docs][base-ui] Fix form submission Select demo #40014

Merged

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Nov 26, 2023

The form submission demo appears incorrect to me. It was added in #34638, but it lacks a form HTML element. Additionally, the statement "When the name prop is set, the Select will render a hidden input with the selected value." is incorrect because the hidden input is always rendered.

I've also removed the sentence in the documentation that reads:

Note how the second Select in the demo above renders a hidden input with the name provided as a prop.

and retained one demo with a form and a submit button.

Preview - https://deploy-preview-40014--material-ui.netlify.app/base-ui/react-select/#form-submission.

@ZeeshanTamboli ZeeshanTamboli added component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Nov 26, 2023
@mui-bot
Copy link

mui-bot commented Nov 26, 2023

Netlify deploy preview

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against c99312d

@ZeeshanTamboli ZeeshanTamboli changed the title [base-ui][Select] Fix form submission [docs][base-ui] Fix form submission Select demo Nov 26, 2023
@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review November 26, 2023 09:59
@ZeeshanTamboli ZeeshanTamboli added the docs Improvements or additions to the documentation label Nov 26, 2023
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! The unconditional rendering of the hidden input was introduced at some point, but apparently the docs were not updated.

docs/data/base/components/select/UnstyledSelectForm.js Outdated Show resolved Hide resolved
docs/data/base/components/select/UnstyledSelectForm.js Outdated Show resolved Hide resolved
@ZeeshanTamboli
Copy link
Member Author

@michaldudak, I noticed that the name prop description for Base UI and Joy UI includes the sentence:

"If the name is provided, the component will render a hidden input element that can be submitted to a server."

Should we consider removing it? Also, useSelect's name prop description is different and doesn't contain the mentioned sentence - https://mui.com/base-ui/react-select/hooks-api/#use-select-parameters-name.

@michaldudak
Copy link
Member

Yes, it's no longer true. Let's remove it.

@ZeeshanTamboli
Copy link
Member Author

ZeeshanTamboli commented Dec 14, 2023

Yes, it's no longer true. Let's remove it.

@michaldudak Done.

@ZeeshanTamboli ZeeshanTamboli merged commit 23ab56d into mui:master Dec 22, 2023
22 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the base-ui-select-fix-form-submission branch December 22, 2023 13:58
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants