Socket
Socket
Sign inDemoInstall

react-dropzone

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropzone - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

index.jsx

42

index.js

@@ -29,2 +29,30 @@ /**

handleClick: function(e) {
e.preventDefault();
var event = new MouseEvent('click', {
'view': window,
'bubbles': true,
'cancelable': false
});
var node = e.target.getElementsByTagName('input')[0];
if (node) {
node.dispatchEvent(event);
}
},
handleChange: function(e) {
e.preventDefault();
this.setState({
isDragActive: false
});
if (this.props.handler) {
var file = e.target && e.target.files && e.target.files[0];
this.props.handler(file);
} else {
console.error('No handler specified to accept the file.');
}
},
handleDrop: function(e) {

@@ -55,3 +83,5 @@ e.preventDefault();

};
dropzoneStyle.overflow = "hidden";
dropzoneStyle.cursor = "pointer";
var messageStyle = {

@@ -68,6 +98,12 @@ display: "table-cell",

var inputStyle = {
position: "absolute",
top: "-100px"
};
return (
<div className="dropzone" style={dropzoneStyle} onDragLeave={this.handleDragLeave} onDragOver={this.handleDragOver} onDrop={this.handleDrop}>
<form className="dropzone" style={dropzoneStyle} onClick={this.handleClick} onChange={this.handleChange} onDragLeave={this.handleDragLeave} onDragOver={this.handleDragOver} onDrop={this.handleDrop}>
<input type="file" style={inputStyle}/>
{this.props.children || <span style={messageStyle}>{this.props.message || "Drop Here"}</span>}
</div>
</form>
);

@@ -74,0 +110,0 @@ }

4

package.json
{
"name": "react-dropzone",
"version": "0.2.0",
"version": "0.3.0",
"description": "Simple HTML5 drag-drop zone in React",
"main": "index.js",
"main": "index.jsx",
"keywords": [

@@ -7,0 +7,0 @@ "react-component",

@@ -31,3 +31,3 @@ react-dropzone

<div>
<Dropzone handler={this.fileHandler} size=200 message="Drag and drop a file here"/>
<Dropzone handler={this.fileHandler} size={200} message="Drag and drop a file here"/>
</div>

@@ -34,0 +34,0 @@ );

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