Skip to content

Commit

Permalink
sync height with new props.value ( #355)
Browse files Browse the repository at this point in the history
When a value is provided as a prop to EnhancedTextarea, the height should be synced. Fixes part II of #355.
  • Loading branch information
mhuebert committed Feb 22, 2015
1 parent f6d3b4f commit 42d558e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/js/enhanced-textarea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ var EnhancedTextarea = React.createClass({
}

if (this.props.onChange) this.props.onChange(e);
},

componentWillReceiveProps: function(nextProps) {
if (nextProps.value != this.props.value) {
this._syncHeightWithShadow(nextProps.value);
}
}
});

Expand Down

0 comments on commit 42d558e

Please sign in to comment.