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

onFileDialogCancel doesn't fire on Firefox on Mac #1031

Closed
1 of 2 tasks
florantara opened this issue Nov 19, 2020 · 8 comments
Closed
1 of 2 tasks

onFileDialogCancel doesn't fire on Firefox on Mac #1031

florantara opened this issue Nov 19, 2020 · 8 comments
Assignees

Comments

@florantara
Copy link

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?
onFileDialogCancel doesn't fire on Firefox on Mac

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

  1. Open this codepen on FF on Mac: https://codepen.io/florantara/pen/1645ab3e5a88cad0b35fc5a5cc045750?editors=1111
  2. Click the "Add img" button
  3. Click "Cancel" on the file dialog

It should log to the console but it doesn't.

What is the expected behavior?
It should fire the event and log to the console.

Please mention other relevant information such as the browser version, Operating System and react-dropzone version.

  • version 11.2.4
  • macOS Catalina
  • Firefox 82.0.3
@rolandjitsu
Copy link
Collaborator

Hmm ... I definitely see the cb called, but it's not called when you'd expect. It looks like it's called only when you focus out and back on the window.

I think this is due to the hacky way we handle this dialog cancel. Because we expect the app window to be out of focus when the dialog is shown, but it seems like Firefox works differently.

Not sure how we could fix this without adding some other hacks. I'm open to suggestions.

@rolandjitsu
Copy link
Collaborator

@florantara would you like to make a PR to address this? I don't have enough time on my hands to do it.

@florantara
Copy link
Author

@rolandjitsu I don't have a lot of time at the moment either, but I'll look into it when I do

@rolandjitsu
Copy link
Collaborator

@florantara any progress on this? Is this still relevant?

@MaxArnaut
Copy link

Still have this issue

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity in the past 60 days. It will be closed if no further activity occurs. If the problem persists please comment here to bump your issue. Thank You - React Dropzone Maintaners

@stale stale bot added the stale label Jan 9, 2022
@rolandjitsu
Copy link
Collaborator

Related to #1079. And I'm not sure we can fix this in any way. There's some promising APIs being worked on to allow file system access and part of that also handling cancelation events.

But as I see it today, the onFileDialogCancel cb is pretty useless for files beyond a few MB. If the file is large, the timeout we have set to check if files were selected will trigger too early and give false positive.

So I'm inclined to deprecate/remove it (maybe just have a onFileDialogOpen/Close which can work) and start using the new file system APIs which are supported by very few browsers (Chrome and Opera I think).

@stale stale bot removed the stale label Jan 30, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 1, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 1, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 1, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 1, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 2, 2022
@rolandjitsu rolandjitsu self-assigned this Feb 2, 2022
rolandjitsu pushed a commit to rolandjitsu/react-dropzone that referenced this issue Feb 5, 2022
rolandjitsu pushed a commit that referenced this issue Feb 5, 2022
@rolandjitsu
Copy link
Collaborator

Closed by 3ad4f00. This is the best I could do for now.

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

No branches or pull requests

3 participants