hopefully stop weird flickering bugs when pressing delete or zero-height textareas...
This commit is contained in:
parent
08618f6ad5
commit
e9b0539b58
1 changed files with 1 additions and 1 deletions
|
@ -240,7 +240,7 @@ module.exports = React.createClass({
|
||||||
resizeInput: function() {
|
resizeInput: function() {
|
||||||
// scrollHeight is at least equal to clientHeight, so we have to
|
// scrollHeight is at least equal to clientHeight, so we have to
|
||||||
// temporarily crimp clientHeight to 0 to get an accurate scrollHeight value
|
// temporarily crimp clientHeight to 0 to get an accurate scrollHeight value
|
||||||
this.refs.textarea.style.height = "0px";
|
this.refs.textarea.style.height = "20px"; // 20 hardcoded from CSS
|
||||||
var newHeight = Math.min(this.refs.textarea.scrollHeight,
|
var newHeight = Math.min(this.refs.textarea.scrollHeight,
|
||||||
this.constructor.MAX_HEIGHT);
|
this.constructor.MAX_HEIGHT);
|
||||||
this.refs.textarea.style.height = Math.ceil(newHeight) + "px";
|
this.refs.textarea.style.height = Math.ceil(newHeight) + "px";
|
||||||
|
|
Loading…
Reference in a new issue