Skip to content

fix: infer MIME types for files from another window - #209

Merged
rolandjitsu merged 1 commit into
react-dropzone:mainfrom
BelodonaQ:codex/cross-window-file-mime
Oct 31, 2026
Merged

rolandjitsu merged 1 commit into
react-dropzone:mainfrom
BelodonaQ:codex/cross-window-file-mime

Conversation

@BelodonaQ

Copy link
Copy Markdown
Contributor

Files created in another window fail the parent window's instanceof File check, so fromEvent leaves an empty MIME type even when the extension is in the configured lookup. For example, an iframe-created example.json stays typeless instead of receiving application/json.

Identify converted files by the path property that toFileWithPath always adds. This preserves the original File object and keeps non-drop DataTransferItems unchanged. Add iframe regressions in the unit suite and Chromium suite.

Validation: the unit regression fails before the fix and passes afterward; 56 unit tests pass with 100% coverage; all 9 Chromium tests pass. Type-checking, both lint commands, formatting, build, size budgets (2.51 kB ESM / 2.59 kB CJS), and git diff --check pass.

Prepared and verified with OpenAI Codex assistance.

@rolandjitsu
rolandjitsu merged commit 0221878 into react-dropzone:main Oct 31, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants