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

The "copy" cursor icon is displayed when the file type is not supported. Expecting the "none" cursor to be displayed. #1042

Closed
1 of 2 tasks
mdebeus opened this issue Jan 27, 2021 · 5 comments · Fixed by #1053
Labels

Comments

@mdebeus
Copy link

mdebeus commented Jan 27, 2021

Do you want to request a feature or report a bug?

  • I found a bug
  • I want to propose a feature

What is the current behavior?
When dragging a file into the drop-zone, the Copy cursor is displayed, even when the file type is not supported. I believe the fix for issue #749 is the culprit - the dropEffect should be set to "copy" only when the file type is supported, and set to "none" when the file type is not supported.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Drag an unsupported file into the drop-zone

What is the expected behavior?
The cursor shows the "none" dragEffect which indicates that the item may not be dropped.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Operating System and react-dropzone version.
Browser: Chrome, Operating System: Windows, react-dropzone version: 10.2.1

@rolandjitsu
Copy link
Collaborator

@mdebeus the issue is that while dragging there's not much support in browsers to check the file type/size, etc. So it would be difficult to keep consistent across browsers.

Furthermore, the logic for validation is outside of the callback, so it would require a bit of refactoring to change that.

You're welcome to make a PR if you want.

@thenanyu
Copy link

Here

event.dataTransfer.dropEffect = 'copy'
— could we possible test for at least the existence of files? using isEvtWithFiles(event)

Right now, everything that's dragged over a dropzone gets the green (+) sign, including things like links and html5 drag and drop object

@github-actions
Copy link

🎉 This issue has been resolved in version 11.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@diegolameira
Copy link

Hey, just found this is back again with v14.2.2...

Is someone else having same issue as mine?

macOS Monterey 12.4
Chrome: Version 103.0.5060.114 (Official Build) (arm64)
Safari: Version 15.5 (17613.2.7.1.8)

@tim-ninan
Copy link

We are using 14.2.1 and experiencing the same issue as well....

@diegolameira Were you ever able to come to a work-around on this by any chance?

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

Successfully merging a pull request may close this issue.

5 participants