question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IsDragReject evaluating to true even though no error were fired.

See original GitHub issue

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

  • [ X] I found a bug
  • I want to propose a feature

What is the current behavior? Able to drop image but getting isDragReject true which leds to unexpected UI error treatments https://codesandbox.io/s/wandering-tdd-ehs4e

What is the expected behavior? Be able to drop an image and do not get isDragReject with truthy value.

If this is a feature request, what is motivation or use case for changing the behavior? After investigation, I realized that this behavior was inserted by #878.

On this method

export function fileMatchSize(file, maxSize, minSize) { return file.size <= maxSize && file.size >= minSize; }

file.size is undefined which leads to a falsy evaluation, and this file param is a DataTransferItem defined in here: DataTransferItem , having only two read-only props, kind and type, maybe we should use getAsFile method in order to have access to file itself, but on my local it returns undefined.

Please mention other relevant information such as the browser version, Operating System and react-dropzone version. Browser Version: Chrome 77.0.3865.90 OS: Window 10 Pro React Dropzone Version: 10.1.10

Thanks, let me know if I can help somehow.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:16

github_iconTop GitHub Comments

18reactions
Popov85commented, Feb 12, 2020

The issue remains in the scenario if I have accept = ".txt,.doc,.docx" that is a list of comma-separated file extensions. With MIME types it works smoothly.

“react-dropzone”: “^10.2.1”, Windows 7, Chrome Version 79.0.3945.130 (Official Build) (64-bit)

9reactions
nterolcommented, Feb 5, 2021

I’m having this same issue on accept ".jpg, .png, .svg". It fails whatever is the extension of the file.

“react-dropzone”: “^11.2.4”, macOS 11.12, Chrome 88.0.4324.146

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-dropzone: isDragReject is true when accept csv?
When dragging a csv file, this code logs "true, false, true". But react-dropzone accepted the csv file. I tried with images and all...
Read more >
react-dropzone
The dropzone property getters are just two functions that return objects with properties which you need to use to create the drag 'n'...
Read more >
Logo Design, Web Design and E-commerce ... - The Branding Store
We define our GraphQL operations using gql from the @apollo/react-hooks package. We use gql with grave accents (backticks) to parse a GraphQL string....
Read more >
Gravity PDF - Version 4.2.1
+ * Bug - Fix Multisite migration problem where if an error was thrown for one of ... + * Bug - Removed...
Read more >
185dff5264780b74ef8cdc3775c7...
An error occurred while loading commit signatures ... If partial is true,\n * then this function will return true even if only part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found