react-textarea-autosize
Advanced tools
Comparing version 1.0.6 to 1.1.0
12
index.js
@@ -20,4 +20,9 @@ 'use strict'; | ||
this.recalculateSize(); | ||
window.addEventListener('resize', this.recalculateSize); | ||
}, | ||
componentWillUnmount: function() { | ||
window.removeEventListener('resize', this.recalculateSize); | ||
}, | ||
componentDidUpdate: function(prevProps) { | ||
@@ -28,8 +33,7 @@ if ( | ||
// We need to call `recalculateSize()` if component is used in | ||
// uncontrolled mode because the `<texarea />` will re-render itself in | ||
// uncontrolled mode because the `<textarea />` will re-render itself in | ||
// that case. | ||
// | ||
// We check for `== null` to cover both `null` and `undefined`, | ||
// this is what React does check if component is used in uncontrolled | ||
// mode. | ||
// We check for `== null` to cover both `null` and `undefined`, this is | ||
// what React does to check if component is used in uncontrolled mode. | ||
this.props.value == null | ||
@@ -36,0 +40,0 @@ ) { |
{ | ||
"name": "react-textarea-autosize", | ||
"description": "textarea component for React which grows with content", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Andrey Popp", |
8051
136