react-filepond icon indicating copy to clipboard operation
react-filepond copied to clipboard

Expose ref for `<input type="file">` element

Open justrhysism opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. Currently, it's not possible to get the ref for the underlying <input> element which makes this library difficult to use with libraries like "react-hook-form".

Describe the solution you'd like Expose a prop inputRef so the author can provide their own ref.

Describe alternatives you've considered Hacky solutions of traversing the DOM 😢

Additional context N/A

justrhysism avatar Jan 06 '21 22:01 justrhysism

FilePond generates a custom list of input elements to store its data, the elements are removed when files are deleted, not sure how that would work with a ref

rikschennink avatar Jan 08 '21 10:01 rikschennink

how to get the file inside onSubmit then?

bishnu-47 avatar Jan 29 '22 14:01 bishnu-47

get a ref to FilePond component and call getFiles() on the FilePond instance in the ref.

rikschennink avatar Jan 29 '22 15:01 rikschennink