Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
Per the documenation, we are only supposed to modify the drag operation's data store during the dragstart event. We were calling it in the drop event. This was not throwing errors in Chrome, but Firefox, for example would throw a NoModificationAllowedError.
Initially, I figured to move the call to dataTransfer.clearData() to the dragstart event handler. I noticed we did not even have a handler for this method. Then I realized this is because when a user drags a file into our dropzone, we never see the start event of that drag operation.
Therefore, I simply removed the call to dataTransfer.clearData().
Per the documenation, we are only supposed to modify the drag operation's data store during the
dragstart
event. We were calling it in thedrop
event. This was not throwing errors in Chrome, but Firefox, for example would throw aNoModificationAllowedError
.Initially, I figured to move the call to
dataTransfer.clearData()
to thedragstart
event handler. I noticed we did not even have a handler for this method. Then I realized this is because when a user drags a file into our dropzone, we never see the start event of that drag operation.Therefore, I simply removed the call to
dataTransfer.clearData()
.