react-autosize-textarea
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -34,6 +34,10 @@ 'use strict'; | ||
getTextareaDOMNode: function getTextareaDOMNode() { | ||
return this.refs.textarea.nodeType === 1 ? this.refs.textarea : this.refs.textarea.getDOMNode(); | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
(0, _autosize2['default'])(this.refs.textarea.getDOMNode()); | ||
(0, _autosize2['default'])(this.getTextareaDOMNode()); | ||
if (this.props.onResize) { | ||
this.refs.textarea.getDOMNode().addEventListener(RESIZED, this.props.onResize); | ||
this.getTextareaDOMNode().addEventListener(RESIZED, this.props.onResize); | ||
} | ||
@@ -44,3 +48,3 @@ }, | ||
if (this.props.onResize) { | ||
this.refs.textarea.getDOMNode().removeEventListener(RESIZED, this.props.onResize); | ||
this.getTextareaDOMNode().removeEventListener(RESIZED, this.props.onResize); | ||
} | ||
@@ -56,3 +60,3 @@ this.dispatchEvent(DESTROY); | ||
var dispatch = function dispatch() { | ||
return _this.refs.textarea.getDOMNode().dispatchEvent(event); | ||
return _this.getTextareaDOMNode().dispatchEvent(event); | ||
}; | ||
@@ -59,0 +63,0 @@ if (defer) { |
{ | ||
"name": "react-autosize-textarea", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "replacement for built-in textarea which auto resizes itself", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,6 +20,12 @@ import React from 'react'; | ||
getTextareaDOMNode() { | ||
return this.refs.textarea.nodeType === 1 ? | ||
this.refs.textarea : | ||
this.refs.textarea.getDOMNode(); | ||
}, | ||
componentDidMount() { | ||
autosize(this.refs.textarea.getDOMNode()); | ||
autosize(this.getTextareaDOMNode()); | ||
if (this.props.onResize) { | ||
this.refs.textarea.getDOMNode().addEventListener(RESIZED, this.props.onResize); | ||
this.getTextareaDOMNode().addEventListener(RESIZED, this.props.onResize); | ||
} | ||
@@ -30,3 +36,3 @@ }, | ||
if (this.props.onResize) { | ||
this.refs.textarea.getDOMNode().removeEventListener(RESIZED, this.props.onResize); | ||
this.getTextareaDOMNode().removeEventListener(RESIZED, this.props.onResize); | ||
} | ||
@@ -39,3 +45,3 @@ this.dispatchEvent(DESTROY); | ||
event.initEvent(EVENT_TYPE, true, false); | ||
const dispatch = () => this.refs.textarea.getDOMNode().dispatchEvent(event); | ||
const dispatch = () => this.getTextareaDOMNode().dispatchEvent(event); | ||
if (defer) { | ||
@@ -66,3 +72,3 @@ setTimeout(dispatch); | ||
} | ||
}, | ||
} | ||
@@ -69,0 +75,0 @@ }); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
134318
718
0