-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
[BUG] the version 1.2 introduced a regression #106
Comments
@rolandjitsu should we set up a |
That's a bug alright. Thanks @buenjybar for reporting it. @jonkoops yes, we'll need a Let me setup the |
Once #107 goes through, we'll make a bump in react-dropzone as well. |
@buenjybar can you provide some details on how this can be reproduced? Which browser is being used, and in what way is the library called? Please provide a minimal code example like we have in the README. |
Sure the scenario is being done in a cypress e2e tests, I will try to find the best way to reproduce this bug |
Great thanks! Please make sure to provide a minimal and reproducible example that does not include any third party libraries/frameworks such as Cypress, React, etc. |
you can see how to reproduce the bug here. |
That example still contains a bunch of framework specific code, could you provide a minimal example without React and testing frameworks and only |
In the code sample there is nothing sophisticated.
|
I have added this to reproduce the issue #108 |
@buenjybar I did a bit of refactoring, could you tell me if #114 fixes the problem for you? |
I've also filed cypress-io/cypress#30629 to see if the Cypress team can provide any insight. |
Hmmm ... it seems like this may be a browser issue. If you try the following in Chrome 130: const dt = new document.defaultView.DataTransfer();
const js = JSON.stringify({test: 1});
const b = new Blob([js], {type: "application/json"});
const f = new File([b], "test.json");
dt.items[0].getAsFileSystemHandle().then(h => console.log(h)) You'll get I'm not sure what that means, but that's where the problem is. We expect a file or dir handle, but we get undefined. I mean, it is an experimental API, so it's to be expected. But in Chrome, the API should be available and work according to the compatibility table. It might also be the fact that I've done that from the console and not the UI, which may be a security issue which gets blocked by the secure context feature? 😕 |
🎉 This issue has been resolved in version 2.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 3.0.0-beta.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I can confirm the Fix in 2.1.2 👍 |
Describe the bug
A clear and concise description of what the bug is.
When running the new version of
react-dropzone: @14.3.5
link, I noticed a regression introduced in this library🐛 This bug was introduced in this commit
The actual error is
FileDrop-ky6DIxvn.js:5
Accordingly to the experimental documentation of DataTransferItem: getAsFileSystemHandle() method MDN
The return value can be a promise or
null
, but the current code doesn't managenull
valuesExpected behavior
A clear and concise description of what you expected to happen.
This shouldn't crash at runtime
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
It seems that the old/legacy behavior is working as expected.
The text was updated successfully, but these errors were encountered: