Conversation
Co-Authored-By: Vachmara <55046446+vachmara@users.noreply.github.com>
✅ Deployed ui3
|
|
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.
@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.
Do you have a suggestion to implement this? 🤔
There was a problem hiding this comment.
adding inputRef.value.value = '' should resolve this edge case
There was a problem hiding this comment.
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