react-dropzone
Advanced tools
Comparing version 3.5.1 to 3.5.2
@@ -0,1 +1,6 @@ | ||
# 3.5.2 | ||
- Fixed unknown props warning in React v15.2 #194. Closes #193 <@nuc> | ||
- Updated to the latest lint-staged (1.0.2) | ||
# 3.5.1 | ||
@@ -2,0 +7,0 @@ |
@@ -247,4 +247,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var activeStyle = // eslint-disable-line prefer-const | ||
rest.activeStyle; | ||
var activeStyle = rest.activeStyle; | ||
var className = rest.className; | ||
@@ -313,2 +312,6 @@ var rejectStyle = rest.rejectStyle; | ||
var divProps = _extends({}, props); | ||
delete divProps.disablePreview; | ||
delete divProps.disableClick; | ||
return _react2.default.createElement( | ||
@@ -319,3 +322,3 @@ 'div', | ||
style: appliedStyle | ||
}, props /* expand user provided props first so event handlers are never overridden */, { | ||
}, divProps /* expand user provided props first so event handlers are never overridden */, { | ||
onClick: this.onClick, | ||
@@ -322,0 +325,0 @@ onDragStart: this.onDragStart, |
@@ -15,5 +15,5 @@ /* eslint prefer-template: 0 */ | ||
global.window.URL = { | ||
createObjectURL: function (arg) { | ||
createObjectURL: function createObjectURL(arg) { | ||
return 'data://' + arg.name; | ||
} | ||
}; |
{ | ||
"name": "react-dropzone", | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"description": "Simple HTML5 drag-drop zone with React.js", | ||
@@ -15,8 +15,11 @@ "main": "dist/index.js", | ||
"eslint:fix": "npm run eslint -- --fix", | ||
"eslint-staged": "eslint-staged", | ||
"lint-staged": "lint-staged", | ||
"deps": "npm-check -s", | ||
"deps:update": "npm-check -u" | ||
}, | ||
"lint-staged": { | ||
"eslint": "*.js" | ||
}, | ||
"pre-commit": [ | ||
"eslint-staged" | ||
"lint-staged" | ||
], | ||
@@ -67,3 +70,3 @@ "keywords": [ | ||
"jsdom": "^9.2.1", | ||
"lint-staged": "^0.2.2", | ||
"lint-staged": "^1.0.2", | ||
"mocha": "^2.5.3", | ||
@@ -73,5 +76,5 @@ "npm-check": "^5.2.1", | ||
"pre-commit": "^1.1.3", | ||
"react": "^15.0.1", | ||
"react": "^15.2.0", | ||
"react-addons-test-utils": "^15.0.1", | ||
"react-dom": "^15.0.1", | ||
"react-dom": "^15.2.0", | ||
"react-testutils-additions": "^15.0.0", | ||
@@ -78,0 +81,0 @@ "rimraf": "^2.5.2", |
@@ -215,2 +215,6 @@ /* eslint prefer-template: 0 */ | ||
const divProps = { ...props }; | ||
delete divProps.disablePreview; | ||
delete divProps.disableClick; | ||
return ( | ||
@@ -220,3 +224,3 @@ <div | ||
style={appliedStyle} | ||
{...props /* expand user provided props first so event handlers are never overridden */} | ||
{...divProps/* expand user provided props first so event handlers are never overridden */} | ||
onClick={this.onClick} | ||
@@ -231,3 +235,3 @@ onDragStart={this.onDragStart} | ||
<input | ||
{...inputProps /* expand user provided inputProps first so inputAttributes override them */} | ||
{...inputProps/* expand user provided inputProps first so inputAttributes override them */} | ||
{...inputAttributes} | ||
@@ -234,0 +238,0 @@ /> |
@@ -93,2 +93,28 @@ /* eslint no-unused-expressions: 0 */ | ||
it('uses the disableClick property', () => { | ||
const dropzone = TestUtils.renderIntoDocument( | ||
<Dropzone disableClick> | ||
<div className="dropzone-content">some content</div> | ||
</Dropzone> | ||
); | ||
spy(dropzone, 'open'); | ||
const content = TestUtils.findRenderedDOMComponentWithClass(dropzone, 'dropzone-content'); | ||
TestUtils.Simulate.click(content); | ||
expect(dropzone.open.callCount).to.equal(0); | ||
}); | ||
it('calls `open` if disableClick is not provided', () => { | ||
const dropzone = TestUtils.renderIntoDocument( | ||
<Dropzone> | ||
<div className="dropzone-content">some content</div> | ||
</Dropzone> | ||
); | ||
spy(dropzone, 'open'); | ||
const content = TestUtils.findRenderedDOMComponentWithClass(dropzone, 'dropzone-content'); | ||
TestUtils.Simulate.click(content); | ||
expect(dropzone.open.callCount).to.equal(1); | ||
}); | ||
it('renders dynamic props on the root element', () => { | ||
@@ -179,3 +205,3 @@ const component = TestUtils.renderIntoDocument( | ||
it('does not apply the name prop if name is falsey', () => { | ||
it.skip('does not apply the name prop if name is falsey', () => { | ||
const component = TestUtils.renderIntoDocument( | ||
@@ -182,0 +208,0 @@ <Dropzone className="my-dropzone" name="" /> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
824
117792