Skip to content

Commit

Permalink
Merge pull request formsy#182 from tengis/master
Browse files Browse the repository at this point in the history
FormsyText component needs to adopt underlineStyle and underlineFocusStyle props
  • Loading branch information
Ryan B. Blakeley authored Jan 30, 2017
2 parents 800b4df + 4c2e959 commit 35d8760
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/FormsyText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const FormsyText = React.createClass({
onChange: React.PropTypes.func,
onKeyDown: React.PropTypes.func,
requiredError: React.PropTypes.string,
underlineFocusStyle: React.PropTypes.object,
underlineStyle: React.PropTypes.object,
updateImmediately: React.PropTypes.bool,
validationColor: React.PropTypes.string,
validationError: React.PropTypes.string,
Expand All @@ -23,6 +25,10 @@ const FormsyText = React.createClass({

mixins: [Formsy.Mixin],

defaultProps: {
underlineFocusStyle: {},
underlineStyle: {},
},

componentWillMount() {
this.setValue(this.controlledValue());
Expand Down Expand Up @@ -103,6 +109,8 @@ const FormsyText = React.createClass({
const {
defaultValue, // eslint-disable-line no-unused-vars
requiredError,
underlineFocusStyle,
underlineStyle,
updateImmediately, // eslint-disable-line no-unused-vars
validations, // eslint-disable-line no-unused-vars
validationError, // eslint-disable-line no-unused-vars
Expand All @@ -125,8 +133,8 @@ const FormsyText = React.createClass({
onKeyDown={this.handleKeyDown}
ref={this.setMuiComponentAndMaybeFocus}
value={this.getValue()}
underlineStyle={this.state.isValid ? { color: this.validationColor() } : {}}
underlineFocusStyle={this.state.isValid ? { color: this.validationColor() } : {}}
underlineStyle={this.state.isValid ? { color: this.validationColor() } : underlineStyle}
underlineFocusStyle={this.state.isValid ? { color: this.validationColor() } : underlineFocusStyle}
/>
);
},
Expand Down

0 comments on commit 35d8760

Please sign in to comment.