-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
NEXT: FileUpload component - expose bindable files prop #2842
Comments
skeleton/packages/skeleton-svelte/src/lib/components/FileUpload/FileUpload.svelte Line 116 in a0653e8
Just noticed the file size calc is missing a zero i.e. 1000 * 1000, my upload files were not looking very svelte ;) |
Good catch, we'll also need to adjust it so |
Javascript allows for better number notations, eg: const multiplier = 1_000_000 underscores are removed and they help make it clearer. We can probably use the Intl.NumberFormat function though, this would handle locale aswell. |
From @jpdewing on Discord:
|
First the good news - I've implemented two improvements to the component in the pending PR:
The bad news - I've spent some time testing ways to handle a reset of the File Input within the File Upload component. Sadly I am coming up short on this one. Here's what I've tested thus far:
The only other idea I have is to somehow expose the Zag However, I'm struggling to come up with a clean way to handle this. So for now I'm open to other ideas or suggestions! |
Describe the feature in detail (code, mocks, or screenshots encouraged)
Would it be possible to expose a
files
prop for two-way binding or provide a way to access the files that have been added to acceptedFiles.This would allow for something external to update/clear the uploaded files. My specific use case would be to combine with Superforms that resets the form once successfully submitted and would automatically clear the uploaded files from the component.
What type of pull request would this be?
Enhancement
Provide relevant links or additional information.
No response
The text was updated successfully, but these errors were encountered: