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

Feature Request: Add ability to remove file from input #56

Open
JakeUrban opened this issue Jul 1, 2021 · 3 comments
Open

Feature Request: Add ability to remove file from input #56

JakeUrban opened this issue Jul 1, 2021 · 3 comments

Comments

@JakeUrban
Copy link

What problem does your feature solve?

When I upload a file to an input field, sometimes I would like to remove that file or "clear" it, but I cannot do that unless I click the input field and select "cancel" in the file selection menu.

One of the reasons this is needed is because if I try to re-upload the same filename with new contents, the new content is not loaded. This means users need to clear the file in order to re-upload.

What would you like to see?

An "x" or "clear" button that allows users to remove files from the input field. Ideally we can also pass a function that is executed when a file is cleared as well.

@JakeUrban
Copy link
Author

Hi @quietbits I've actually implemented this functionality in the anchor tests suite, see the preview on this PR.

Instructions to see behavior:

  • Enter 'testanchor.stellar.org' to the home domain field
  • Select 'SEP-12'
  • Upload the file attached to this comment under 'Upload Config'
  • Select 'Upload Customer Files'
  • Upload an image to the form within the modal displayed

You'll see the input field change to remove the 'Choose File' button and replace it with a 'Remove File' button. I think this is a much better experience for the user. You can see the source code for handling this change here.

cc @shanzzam

@JakeUrban
Copy link
Author

JakeUrban commented Jul 29, 2021

config.json.zip

Upload the uncompressed version

@quietbits
Copy link
Contributor

Thanks, @JakeUrban ! This is a much better user experience, I agree. We will check with the design how to style it and implement a more generic version in the SDS.

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

No branches or pull requests

2 participants