Skip to content

Commit

Permalink
Added hintStyle property
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Gribben committed Aug 25, 2015
1 parent dcd7d00 commit a19f53d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/src/app/components/pages/components/text-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ let TextFieldsPage = React.createClass({
<TextField
style={styles.textfield}
hintText="Hint Text" /><br/>
<TextField
style={styles.textField}
hintText="Styled Hint Text"
hintStyle={{color: 'red'}} /><br/>
<TextField
style={styles.textfield}
hintText="Hint Text"
Expand Down
4 changes: 4 additions & 0 deletions docs/src/app/components/raw-code/text-fields-code.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//In Line Hint Text
<TextField
hintText="Hint Text" />
<TextField
style={styles.textField}
hintText="Styled Hint Text"
hintStyle={{color: 'red'}} />
<TextField
hintText="Hint Text"
defaultValue="Default Value" />
Expand Down
4 changes: 3 additions & 1 deletion src/text-field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ let TextField = React.createClass({
React.PropTypes.string,
React.PropTypes.element,
]),
hintStyle: React.PropTypes.object,
id: React.PropTypes.string,
inputStyle: React.PropTypes.object,
multiLine: React.PropTypes.bool,
Expand Down Expand Up @@ -240,6 +241,7 @@ let TextField = React.createClass({
floatingLabelText,
fullWidth,
hintText,
hintStyle,
id,
multiLine,
onBlur,
Expand All @@ -259,7 +261,7 @@ let TextField = React.createClass({
) : null;

let hintTextElement = hintText ? (
<div style={this.mergeAndPrefix(styles.hint)}>{hintText}</div>
<div style={this.mergeAndPrefix(styles.hint, this.props.hintStyle)}>{hintText}</div>
) : null;

let floatingLabelTextElement = floatingLabelText ? (
Expand Down

0 comments on commit a19f53d

Please sign in to comment.