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

[doc] Adding the 'type' attribute description of <ButtonBase> #11683

Closed
chocolatl opened this issue Jun 2, 2018 · 5 comments
Closed

[doc] Adding the 'type' attribute description of <ButtonBase> #11683

chocolatl opened this issue Jun 2, 2018 · 5 comments
Labels
component: ButtonBase The React component. docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@chocolatl
Copy link
Contributor

chocolatl commented Jun 2, 2018

In HTML, the default value of the type attribute of the <button> tag is "submit", but in MDUI's <ButtonBase>, the default value of the type attribute is "button", which results in no form submission behavior by default.
This difference was confusing to me, although the type attribute of <ButtonBase> can be specified, but the doc did not give instructions, I hope to add a description of the type attribute in the document

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process. component: ButtonBase The React component. labels Jun 2, 2018
@oliviertassinari
Copy link
Member

In HTML, the default value of the type attribute of the tag is "submit"

@chocolatl Yes, I can confirm this point: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button.

I hope to add a description of the type attribute in the document

I'm all 💯 with you on this pain point. There is room for improvement. We should improve the description:
https://github.com/mui-org/material-ui/blob/b431b3b40c01cd7f2c649010136cb4a919914ccd/packages/material-ui/src/ButtonBase/ButtonBase.js#L425-L428

@oliviertassinari
Copy link
Member

@chocolatl Do you want to work on it?

@chocolatl
Copy link
Contributor Author

@oliviertassinari I'm afraid not, My English is very bad 😓.

@pnkapadia6
Copy link

@oliviertassinari Can I fix this? Do we only want to add the prop's description in the doc? Or change the default value of it to submit as well?

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 3, 2018

@pnkapadia6 Of course, no need to ask :). The default value is expected. We need to make the behavior explicit in the API documentation page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonBase The React component. docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

3 participants