kobalte
kobalte copied to clipboard
Can't add same file to `FileField` just after removing it
Describe the bug After deleting file from field, trying to add the same file doesn't work.
To Reproduce Steps to reproduce the behavior:
- Use something like that (has delete triggers)
<FileField> <FileField.Trigger> Choose </FileField.Trigger> <FileField.HiddenInput /> <FileField.ItemList> {(file) => { return ( <FileField.Item> <FileField.ItemName /> <FileField.ItemDeleteTrigger> DELETE </FileField.ItemDeleteTrigger> </FileField.Item> ); }} </FileField.ItemList> </FileField> - Add single file, it shows up
- Click delete trigger, it hides
- Add the same single file, nothing shows up
Expected behavior
At step 4 same item should show up.
That's from simple <input type="file" /> behaviour, the input could just be reset after each add.
Aside from this, idk if it's possible but... Same file can be added twice if there was some file added in between. With the new behaviour it would be possible to add same file without anything in between. Could there be mechanism to detect if file was already added, and if so just skip it?