Skip to content

Commit

Permalink
Merge pull request #1493 from agenthunt/textfieldUnderline
Browse files Browse the repository at this point in the history
[TextField] Added props to override underlineStyle when disabled
  • Loading branch information
hai-cea committed Sep 7, 2015
2 parents b2faa18 + 54ddc67 commit 4e81c7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/src/app/components/pages/components/text-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ let TextFieldsPage = React.createClass({
header: 'optional',
desc: 'Override the inline-styles of the TextField\'s underline element when focussed.'
},
{
name: 'underlineDisabledStyle',
type: 'object',
header: 'optional',
desc: 'Override the inline-styles of the TextField\'s underline element when disabled.'
},
{
name: 'type',
type: 'string',
Expand Down Expand Up @@ -224,6 +230,11 @@ let TextFieldsPage = React.createClass({
style={styles.textfield}
hintText="Custom Underline Focus Color"
underlineFocusStyle={{borderColor: Colors.amber900}} /><br />
<TextField
style={styles.textfield}
disabled={true}
hintText="Custom Underline Disabled Style"
underlineDisabledStyle={{borderColor:Colors.purple500, borderBottom: 'solid 1px'}} /><br />
<TextField
style={styles.textfield}
hintText="Hint Text"
Expand Down
2 changes: 2 additions & 0 deletions src/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let TextField = React.createClass({
type: React.PropTypes.string,
underlineStyle: React.PropTypes.object,
underlineFocusStyle: React.PropTypes.object,
underlineDisabledStyle: React.PropTypes.object,
},

getDefaultProps() {
Expand Down Expand Up @@ -180,6 +181,7 @@ let TextField = React.createClass({

styles.error = this.mergeAndPrefix(styles.error, props.errorStyle);
styles.underline = this.mergeAndPrefix(styles.underline, props.underlineStyle);
styles.underlineAfter = this.mergeAndPrefix(styles.underlineAfter, props.underlineDisabledStyle);

styles.floatingLabel = this.mergeStyles(styles.hint, {
lineHeight: '22px',
Expand Down

0 comments on commit 4e81c7c

Please sign in to comment.