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

[FlatButton] Add labelPosition prop. #1286

Merged
merged 4 commits into from
Aug 21, 2015

Conversation

vaiRk
Copy link
Contributor

@vaiRk vaiRk commented Jul 29, 2015

At the moment FlatButtons always render the label before any passed children.

I've added a labelPosition prop to allow changing the order of the elements.
Defaults to right as I thought the most common use is adding a FontIcon or similar which is normally placed on the left hand side of the button.

type: 'string',
header: 'default: "right"',
desc: 'Place label before or after the passed children'
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing comma here.

@vaiRk
Copy link
Contributor Author

vaiRk commented Jul 29, 2015

@hai-cea good catch, fixed!

@@ -26,6 +26,7 @@ let FlatButton = React.createClass({
disabled: React.PropTypes.bool,
hoverColor: React.PropTypes.string,
label: validateLabel,
labelPosition: React.PropTypes.oneOf(['left', 'right']),
Copy link
Member

Choose a reason for hiding this comment

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

I think these should be one of before or after. Since that is a truer indication of what it's doing.

@vaiRk
Copy link
Contributor Author

vaiRk commented Aug 21, 2015

+1 Rebased, renamed to "before" and "after" and made beforedefault.

hai-cea added a commit that referenced this pull request Aug 21, 2015
[FlatButton] Add labelPosition prop.
@hai-cea hai-cea merged commit 5a2de1a into mui:master Aug 21, 2015
@hai-cea
Copy link
Member

hai-cea commented Aug 21, 2015

Thanks @vaiRk

@oliviertassinari
Copy link
Member

I have just tested the feature. I have an issue. I think that labelPosition should default to after. I'm gonna submit a PR to fix this.

@zannager zannager added the component: button This is the name of the generic UI component, not the React module! label Mar 15, 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.

4 participants