-
Notifications
You must be signed in to change notification settings - Fork 804
feat(FileUpload): new component #4564
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
Conversation
Co-Authored-By: Vachmara <[email protected]>
β Deployed ui3
π View deployment logs |
A few open points from OriginUI that we still need to resolve in the new implementation:
Happy to discuss these further to help move things forward! |
@vachmara I just pushed a new version with lots of improvements, it introduces:
Those should handle most cases and I'm pretty happy with the result! Which @genu's suggestion are you talking about? π€ Feel free to play with the component in the playground and give feedback π |
|
||
const files = [...modelValue.value as File[]] | ||
files.splice(index, 1) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjamincanac We should also reset the inputRef
value to handle this edge case:
If a user drops example.png
, deletes it, and then tries to re-upload the same file, the input still thinks the file is present, preventing the re-upload.
EDIT: This issue doesn't occur with drag-and-drop, but happens when using the native file picker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a suggestion to implement this? π€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding inputRef.value.value = ''
should resolve this edge case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok it took me some time because this wasn't working: 3e87dc6
I had to move the useFileDialog
into a onMounted()
because of vueuse/vueuse#4867
Based on @genu's suggestion above, I implemented this pattern by introducing a custom item type (not sure if itβs the best way): export type FileUploadItem<Meta = Record<string, any>> = {
file: File
} & Meta |
commit: |
π Linked issue
Resolves #1945
β Type of change
π Description
π Checklist