-
Notifications
You must be signed in to change notification settings - Fork 258
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
Reset uploader component #739
Comments
Thanks for bringing this up. I've noticed this too. I'll take a look this week. Seems like it should be fixable, but if not I think this could work: https://google.github.io/mesop/components/?h=reset#resetting-a-component as a temporary workaround. |
Here are a few options (no particular order) API-wise:
I think I'm going to go with option 2. This way, a user can upload a file and no filename will show at all (if that's what they want). This works for now since the upload is immediate. No need to select a file and press an upload button. The main drawback with number 2 is if a user sets a filename even though nothing has been uploaded. But I think that is OK. |
Sorry for the delay on this. Thought I could get to it before I went OOO for a week. Unfortunately did not get to it. My solution for this ended up being to remove the labels altogether. I realized they were a bit redundant and could be added manually in Mesop anyway which would give more flexibility. |
Describe the bug
Currently MESOP Uploader component cannot be reloaded / refreshed / reset
https://google.github.io/mesop/components/uploader/
To Reproduce
Upload a file with the uploader component and you fill get the "file name" beside the upload button.
But if one is implementing a "clear" button (e.g. in a chat) it is not possible to remove the "file name" text after the uploader button.
Expected behavior
Add a clear / refresh feature for the component
Screenshots
Before:
After pressing clear (this removes UploadedFile from state) but the uploader component (file name) cannot be "reset" and still shows the demo-image1.png
The text was updated successfully, but these errors were encountered: