Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): remove clearData call in dropzone drop handler #10475

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Jan 9, 2025

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 due to the usage of the dataTransfer.clearData function.

As per MDN 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 removing the call to clearData in the handleDrop of the Dropzone component.

Notes:

  • The removal of this call to clearData shouldn't have an impact outside of removing the error as the call was somewhat redundant in that it does not affect files. In my testing, the Dropzone and BulkUpload components behave as expected.
  • Noticed another Firefox bug where the OffscreenCanvas causes an error when handling svg files while creating thumbnails. This is used in the BulkUpload drawers FileManager. I'll investigate this further and create an appropriate issue, and hopefully a PR for this.

Fixes #10472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant