Open alexanderwhatley opened 7 years ago
I would venture to guess that your eventHandlers
doesn't include a pointer to this.maxfilesexceeded
.
If you refer to the example_default.jsx
file, the diff I have is:
--- a/example/src/example_default.jsx
+++ b/example/src/example_default.jsx
@@ -10,7 +10,8 @@ export default class Example extends React.Component {
// please consult http://www.dropzonejs.com/#configuration
this.djsConfig = {
addRemoveLinks: true,
- acceptedFiles: "image/jpeg,image/png,image/gif"
+ acceptedFiles: "image/jpeg,image/png,image/gif",
+ maxFiles: 1,
};
this.componentConfig = {
@@ -31,6 +32,8 @@ export default class Example extends React.Component {
this.removedfile = file => console.log('removing...', file);
this.dropzone = null;
+
+ this.maxfilesexceeded = file => console.log("Max Files Exceeded");
}
render() {
@@ -43,7 +46,8 @@ export default class Example extends React.Component {
drop: this.callbackArray,
addedfile: this.callback,
success: this.success,
- removedfile: this.removedfile
+ removedfile: this.removedfile,
+ maxfilesexceeded: this.maxfilesexceeded,
}
return <DropzoneComponent config={config} eventHandlers={eventHandlers} djsConfig={djsConfig} />
Trying to add a second image results in seeing the console message "Max Files Exceeded".
I have the following code, similar to your example:
However, the maxfilesexceeded never gets called. Do you know why? Thanks.