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

Fix errorText positioning of SelectField if floatingLabelText is set … #1341

Merged
merged 1 commit into from
Aug 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/select-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let SelectField = React.createClass({
selectFieldRoot: React.PropTypes.string,
underlineStyle: React.PropTypes.object,
labelStyle: React.PropTypes.object,
errorStyle: React.PropTypes.object,
hintText: React.PropTypes.string,
id: React.PropTypes.string,
multiLine: React.PropTypes.bool,
Expand Down Expand Up @@ -65,6 +66,7 @@ let SelectField = React.createClass({
borderTop: 'none',
},
input: {},
error: {},
};

if (!this.props.floatingLabelText) {
Expand All @@ -77,6 +79,9 @@ let SelectField = React.createClass({
styles.root.top = -8;
}
}
else {
styles.error.bottom = -15;
}

return styles;
},
Expand All @@ -88,6 +93,7 @@ let SelectField = React.createClass({
labelStyle,
iconStyle,
underlineStyle,
errorStyle,
selectFieldRoot,
menuItems,
disabled,
Expand All @@ -104,6 +110,7 @@ let SelectField = React.createClass({
hintText: (!hintText && !floatingLabelText) ? ' ' : hintText,
fullWidth: fullWidth,
errorText: errorText,
errorStyle: this.mergeAndPrefix(styles.error, errorStyle),
};
let dropDownMenuProps = {
menuItems: menuItems,
Expand Down