react-dropzone / file-selector

Convert a DragEvent or file input to a list of File objects
MIT License
95 stars 33 forks source link

feat: add FileSystemFileHandle support #79

Closed tomayac closed 1 month ago

tomayac commented 1 month ago

What kind of change does this PR introduce?

Did you add tests for your changes?

I think TypeScript doesn't know about this feature yet: Property 'getAsFileSystemHandle' does not exist on type 'DataTransferItem'..

If relevant, did you update the documentation?

Summary Dropped files could be edited right away (instead of forcing a download of a copy), which would be a great win for apps that need to modify dropped files, like online image editors. Also see the MDN docs.

Does this PR introduce a breaking change? If this PR introduces a breaking change, please describe the impact and a migration path for existing applications.

Other information Sorry, I don't know much TypeScript. This will need someone to teach TypeScript that 'getAsFileSystemHandle' exists on type 'DataTransferItem'. I wasn't sure how to test this in, since the tests fail because of the TypeScript issue.

rolandjitsu commented 1 month ago

Released with https://github.com/react-dropzone/file-selector/pull/91.