From b8baf8a13dfaace7def814471e21f5522c4e6bc8 Mon Sep 17 00:00:00 2001 From: Paul Dubs Date: Wed, 5 Aug 2015 11:53:05 +0200 Subject: [PATCH] Fix errorText positioning of SelectField if floatingLabelText is set and allow to set errorStyle on SelectField --- src/select-field.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/select-field.jsx b/src/select-field.jsx index a339bbcb351369..600651bc5a9fe0 100644 --- a/src/select-field.jsx +++ b/src/select-field.jsx @@ -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, @@ -65,6 +66,7 @@ let SelectField = React.createClass({ borderTop: 'none', }, input: {}, + error: {}, }; if (!this.props.floatingLabelText) { @@ -77,6 +79,9 @@ let SelectField = React.createClass({ styles.root.top = -8; } } + else { + styles.error.bottom = -15; + } return styles; }, @@ -88,6 +93,7 @@ let SelectField = React.createClass({ labelStyle, iconStyle, underlineStyle, + errorStyle, selectFieldRoot, menuItems, disabled, @@ -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,