unclecheese/silverstripe-dropzone

The javascript fails with recursion error message

Opened this issue · 0 comments

The javascript fails with recursion calls to add, error, & remove functions of the dropzone JS. In the end, it stops with the following error. “Uncaught RangeError: Maximum call stack size exceeded”.

To replicate:

  • Create field with the option multiple set to false.
  • Drag and drop multiple files.
  • After few sections, you will see the error message in Chrome console.

If you register a callback on the events (addedfile, removedfile, & error) you will see these are called repeatedly.

The issue is within these lines: https://github.com/unclecheese/silverstripe-dropzone/blob/master/javascript/file_attachment_field.js#L76-L81
The event called for each of the rejected files but also adds the rejected file back to the dropzone.