ui
ui copied to clipboard
feat(upload): add resetUpload method to clear uploaded files
๐ Linked issue
N/A
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [x] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
Do we need to publish a new version of a package?
- [x] Add a changeset
pnpm changesetand select what semver changes your PR is adding- commit and push the generated changeset file
๐ Checklist
- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
๐ Description
This PR adds a new method resetUpload() to the
It allows:
- Manually clearing selected file(s)
- Resetting validation state (e.g., after successful form submission)
- Resetting native input value to allow re-upload of the same file
Currently, there is no built-in way to programmatically reset the upload input. This makes it difficult to clear the component after successful form submissions or cancellation actions. This method provides a clean, predictable way to reset the UI and internal state.
Tested successfully in a Nuxt 3 app using both direct