Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-autosize-textarea

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-autosize-textarea - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

12

lib/TextareaAutosize.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc