Commit b4e6761
fix(ui): remove clearData call in dropzone drop handler (#10475)
### What?
This PR fixes an issue for Firefox users where dropping files over a
dropzone component caused a
`NoModificationAllowedError: Modifications are not allowed for this
document` error due to the usage of the `dataTransfer.clearData`
function.
As [per
MDN](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/clearData)
docs, the `clearData` function does not remove files from drag
operations anyway, and can only be used in the context of a `dragStart`
event.
### Why?
To prevent a runtime error encountered while dropping files over
dropzones.
### How?
By wrapping a try/catch around the `clearData` call in the `handleDrop`
of the `Dropzone` component.
Fixes #10472
---------
Co-authored-by: Jessica Chowdhury <jessica@trbl.design>1 parent 5edba8e commit b4e6761
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| |||
0 commit comments