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

set enhanced-button type=button default #1017

Merged
merged 3 commits into from
Jul 2, 2015
Merged

set enhanced-button type=button default #1017

merged 3 commits into from
Jul 2, 2015

Conversation

ustccjw
Copy link
Contributor

@ustccjw ustccjw commented Jul 2, 2015

when use in form, button's type is "submit" (default, such as chrome).
enhanced-button is basic button in material-ui (such as datepicker use), when use datepicker in a form, you do not wish to submit form when click some tool button.

@ustccjw
Copy link
Contributor Author

ustccjw commented Jul 2, 2015

#996

@ustccjw
Copy link
Contributor Author

ustccjw commented Jul 2, 2015

@hai-cea buttonProps should not set type="button", because you may set type="submit", as follows:
<RaisedButton type="submit" label="新建活动" />
https://github.com/ustccjw/material-ui/blob/64336c6389b6181a2c8355f9c7379751f54d6ec4/src/enhanced-button.jsx#L133

@hai-cea
Copy link
Member

hai-cea commented Jul 2, 2015

@ustccjw What I mean is that we should pass the prop along in button props - similar to how I handled tabIndex. Yes, the type prop will get passed along thought the ...other variable, but I think it's good to be explicit about it. So in button props you'll have:

type={type}

Also check out - https://facebook.github.io/react/docs/transferring-props.html#consuming-and-transferring-the-same-prop

@ustccjw
Copy link
Contributor Author

ustccjw commented Jul 2, 2015

@hai-cea ok, i have fixed.

@hai-cea
Copy link
Member

hai-cea commented Jul 2, 2015

Thanks @ustccjw

hai-cea pushed a commit that referenced this pull request Jul 2, 2015
set enhanced-button type=button default
@hai-cea hai-cea merged commit 287e52f into mui:master Jul 2, 2015
@zannager zannager added the component: button This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants