react-dropzone
Advanced tools
Comparing version 10.0.4 to 10.0.5
@@ -527,3 +527,7 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
if (event.dataTransfer) { | ||
event.dataTransfer.dropEffect = 'copy'; | ||
try { | ||
event.dataTransfer.dropEffect = 'copy'; | ||
} catch (_unused) {} | ||
/* eslint-disable-line no-empty */ | ||
} | ||
@@ -530,0 +534,0 @@ |
@@ -168,3 +168,3 @@ { | ||
}, | ||
"version": "10.0.4", | ||
"version": "10.0.5", | ||
"engines": { | ||
@@ -171,0 +171,0 @@ "node": ">= 8" |
@@ -500,3 +500,5 @@ /* eslint prefer-template: 0 */ | ||
if (event.dataTransfer) { | ||
event.dataTransfer.dropEffect = 'copy' | ||
try { | ||
event.dataTransfer.dropEffect = 'copy' | ||
} catch {} /* eslint-disable-line no-empty */ | ||
} | ||
@@ -503,0 +505,0 @@ |
@@ -431,2 +431,38 @@ /* eslint react/prop-types: 0 */ | ||
}) | ||
test('refs are set when {refKey} is set to a different value', done => { | ||
const data = createDtWithFiles(files) | ||
class MyView extends React.Component { | ||
render() { | ||
const { children, innerRef, ...rest } = this.props | ||
return ( | ||
<div id="dropzone" ref={innerRef} {...rest}> | ||
<div>{children}</div> | ||
</div> | ||
) | ||
} | ||
} | ||
const ui = ( | ||
<Dropzone> | ||
{({ getRootProps }) => ( | ||
<MyView {...getRootProps({ refKey: 'innerRef' })}> | ||
<span>Drop some files here ...</span> | ||
</MyView> | ||
)} | ||
</Dropzone> | ||
) | ||
const { container } = render(ui) | ||
const dropzone = container.querySelector('#dropzone') | ||
const fn = async () => { | ||
fireDrop(dropzone, data) | ||
await flushPromises(ui, container) | ||
done() | ||
} | ||
expect(fn).not.toThrow() | ||
}) | ||
}) | ||
@@ -433,0 +469,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
311725
4377