fix(Upload): value prop is added#89
Merged
Merged
Conversation
atakanbayrak
requested changes
Jun 22, 2026
atakanbayrak
left a comment
Contributor
There was a problem hiding this comment.
There was nothing to wrong with work mechanism's of components with this new feature, there are only few things that I would like to discuss in advance.
atakanbayrak
approved these changes
Jun 22, 2026
ZehranurC
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR basically integrates files already in the server, into the Upload components (UploadDragger, List, Input) with the value prop. In order to achieve this, a new external type is introduced and components are fixed to map that type to the internal file types. Form side registrations are also enhanced.
I tried to gather together the changes I've made and issues I've faced below. They are not all of the changes but at least this gives an insight.
uploaded: truemissingf.uploadeduploaded: truefile.downloadinstead of a dedicated statusf.uploaded === truecauses early return, skipping size/type/count checks for server filesremoveFilesroutingf.uploaded) go to_deleteFilesFromServerinstead of local-only removalf.status !== STATUS.CHECK_FAILto count occupied slots_isSameFileignores server fileslastModifiedfrom comparison; now matches onname + size + typeonlyfileis a plain object cast asFileFileType.filenarrowed toPick<File, 'name'|'size'|'type'>;as Filecast at the 3 call sites that need the real instance. Discriminated union/type guard alternatives considered and rejected.setSelectedFiles; server files return samefref from early-return, so no state update firesFileObject[]for UploadList/UploadDraggermapExternalValuehelper inhelper.ts; conversion now happens beforeuseRegisterFormFieldso form always receivesFileType[]UploadItemSyncValidationmissing from UploadList/UploadDraggerdefaultValidations: [Validations.UploadItemSyncValidation]to both components'useRegisterFormFieldcallstoFormValuehelper stripsdownload,addedByValue, andrequestbeforeonFormFieldValueUpdateand externalonChangeType of Change
Screenshots / Preview
Checklist
How to Test