Description
The FileUpload component renders multiple hidden <input type="file"> elements and attaches the same inputRef to more than one input instance.
This can cause the ref to point only to the last rendered input, making keyboard shortcuts or programmatic .click() calls unreliable. It also leaves redundant hidden file inputs in the DOM.
Actual Behavior
inputRef is attached to multiple hidden file inputs inside FileInfo and DropZone
- Duplicate hidden file inputs exist in the same render branch
- Actions like
inputRef.current?.click() may target an unexpected input
- File picker behavior can become inconsistent
Expected Behavior
- Only one hidden file input should exist per
FileUpload instance
inputRef should be attached only once
- All triggers (
Change button, Ctrl + O, drop zone click) should consistently open the same file picker
Steps to Reproduce
- Open the app
- Upload a file so the
FileInfo view renders
- Inspect the DOM and observe multiple hidden
input[type="file"] elements
- Try using the
Change button or Ctrl + O
- Observe inconsistent file picker behavior
Impact
- Potential UX inconsistencies
- Ref behavior becomes unreliable
- Adds unnecessary DOM duplication
- Makes maintenance and testing harder
Suggested Fix
- Consolidate to a single hidden file input inside the
FileUpload component
- Attach
inputRef only once
- Ensure all triggers use the same input element
- Remove duplicated hidden inputs and duplicate
onChange handlers
Description
The
FileUploadcomponent renders multiple hidden<input type="file">elements and attaches the sameinputRefto more than one input instance.This can cause the ref to point only to the last rendered input, making keyboard shortcuts or programmatic
.click()calls unreliable. It also leaves redundant hidden file inputs in the DOM.Actual Behavior
inputRefis attached to multiple hidden file inputs insideFileInfoandDropZoneinputRef.current?.click()may target an unexpected inputExpected Behavior
FileUploadinstanceinputRefshould be attached only onceChangebutton,Ctrl + O, drop zone click) should consistently open the same file pickerSteps to Reproduce
FileInfoview rendersinput[type="file"]elementsChangebutton orCtrl + OImpact
Suggested Fix
FileUploadcomponentinputRefonly onceonChangehandlers