Skip to content

Commit

Permalink
Merge pull request #3 from mlabrum/patch-1
Browse files Browse the repository at this point in the history
Update TextField to support updating value property
  • Loading branch information
evblurbs committed May 27, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 21fea8a + fed8f64 commit dabd780
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/TextField.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,12 @@ export default class TextField extends Component {
focus() {
this.refs.input.focus();
}
componentWillReceiveProps(nextProps: Object){
if(this.props.text != nextProps.value){
nextProps.value.length !== 0 ? this.refs.floatingLabel.floatLabel() : this.refs.floatingLabel.sinkLabel()
this.setState({text: nextProps.value})
}
}
render() {
let {
label,

0 comments on commit dabd780

Please # to comment.