-
Notifications
You must be signed in to change notification settings - Fork 95
Description
ReactUSWDS Version & USWDS Version:
ReactUSWDS: Most current
USWDS: 3.7.1
Describe the bug
Currently, if a user uses the FileInput component with a ref to expose the imperative handle to allow for clearing files through some clear method, once the file is cleared and the user attempt to upload a new file, the new file will not upload.
The handle event will not fire at all.
this is because the exposed clear files function simply clears the state of the files tracked by the component but does not clear the inputs value.
Since the inputs value is not cleared, and is the same value as the previous event, a new event is not fired.
To Reproduce
Steps to reproduce the behavior:
- Go to https://trussworks.github.io/react-uswds/?path=/story/components-file-input--with-ref-and-custom-handlers
- Click on 'choose from folder' and add a file
- Click the 'clear' button
- Repeat step 2
- Notice the new file is not uploaded and the onChange event is not fired
Expected behavior
The onChange event fires and the file has a preview
Screenshots
Additional context
Device and Browser Information (please complete the following information if describing a UI bug):