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

DropZone can't add same file again when remove file from state #425

Closed
jzsplk opened this issue Sep 14, 2018 · 6 comments
Closed

DropZone can't add same file again when remove file from state #425

jzsplk opened this issue Sep 14, 2018 · 6 comments
Assignees
Labels
Bug Something is broken and not working as intended in the system.

Comments

@jzsplk
Copy link

jzsplk commented Sep 14, 2018

Issue summary

Try to add a remove button to clear the files uploaded. Can not add the same file again with click Popover after I have removed it. The onDrop props is ignored.

Expected behavior

Expected I can remove a file from DropZone and I can upload it again.

When I remove the file from state outside the DropZone, the state inside the DropZone ignore the onDrop function for the same file id.

Actual behavior

Steps to reproduce the problem

  1. make a fileDropZone with DropZone component
  2. add a remove function, to clear the files in state in Example component.
  3. use the remove function, and try to add file again with click Popover of DropZone
    it's a sample for this bug:
    https://codesandbox.io/s/01nmwypl8l

Specifications

  • Are you using the React components? (Y/N):Y
  • Polaris version number:2.8.0
  • Browser: Chrome
  • Device: MacBook Pro
  • Operating System: macOs HIGH SIERRA 10.13.6

⚓️ We’re not accepting pull requests at this time

🗒 We are accepting issue reports and feature requests

🌟 Feature requests that we can’t get to right away will be closed. However, we track all requests and will use it to set priorities. See the contribution guidelines for more information.

@dpersing
Copy link
Contributor

Hi @jzsplk! Using your example, I'm able to re-upload a file using the native dialog that appears when the "Add image" text is clicked, as well as by dragging and dropping. Are you still experiencing this issue?

@jzsplk
Copy link
Author

jzsplk commented Sep 21, 2018

@dpersing Hi, still experiencing this issue. You are able to re-upload cause my example has been modify by somebody. In the modified example , DropZone is closed when file uploaded. But I need to keep the DropZone so user can continue to upload with it. I have modified the example back.

@dpersing
Copy link
Contributor

Hi @jzsplk, It looks like I'm still able to upload the same image multiple times. Do you perhaps have a different sandbox that hasn't been altered?

Also, are you using the small-format Drop zone for allowing users to add multiple images? I'd recommend using one of the larger versions if users are meant to upload multiple files.

@vladucu
Copy link

vladucu commented Sep 24, 2018

hi @dpersing !
we're seeing the same issue, here's a reproduction, basically if you upload using the native dialog (not drag-and-drop) then remove the file and try again with the same one, it won't work.

@dpersing
Copy link
Contributor

Hi @vladucu! I'm able to repro with your example. Thanks! I'll share with the team.

@dpersing dpersing added the Bug Something is broken and not working as intended in the system. label Sep 24, 2018
@manishsundriyal
Copy link

Yes, I am also facing the same issue. In my case when a file is rejected by the customValidator is uploaded again then, it's not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system.
Projects
None yet
Development

No branches or pull requests

6 participants