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

Feature Request: Add Button "type" prop #571

Closed
prashnts opened this issue Jan 30, 2017 · 1 comment
Closed

Feature Request: Add Button "type" prop #571

prashnts opened this issue Jan 30, 2017 · 1 comment

Comments

@prashnts
Copy link

It'd be quite nice to have a type prop on the Button component. Currently, it renders as <button type="button" .../>.

In a form, if there is a <button type="submit", then the onSubmit event is fired if return key is pressed from an input field. This is a handy default behaviour which is worth keeping IMO.

I can make a PR adding a type prop to Button component and ButtonType (?) enum to implement this behaviour.

Thanks!

@giladgray
Copy link
Contributor

giladgray commented Jan 30, 2017

Buttons most certainly already support the type prop--they support all HTML props--it's just not listed in the documentation.

@prashnts try it yourself! <Button type="submit" /> should work as expected.

@llorca llorca added this to the 1.8.0 milestone Jan 30, 2017
@giladgray giladgray self-assigned this Jan 30, 2017
giladgray added a commit that referenced this issue Jan 31, 2017
* add docs for Button type prop (fixes #571)

* wrap string children in span so loading can hide them (fixes #572)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants