Fix document upload in Firefox/Safari (outbound Send + DropzoneFileSelect) (#6031)#6032
Open
gqcorneby wants to merge 2 commits into
Open
Fix document upload in Firefox/Safari (outbound Send + DropzoneFileSelect) (#6031)#6032gqcorneby wants to merge 2 commits into
gqcorneby wants to merge 2 commits into
Conversation
The outbound and combined-shipments Send pages rendered the react-dropzone
render-prop without <input {...getInputProps()} />, so on non-Chromium /
non-secure-context browsers (where react-dropzone v14 falls back to a hidden
input) open() had no input to trigger and nothing happened. Add the fallback
input, matching inbound/SendMovementPage.jsx.
Fixes openboxes#6031
DropzoneFileSelect kept onChange inside {...fieldProps} and spread it onto the
wrapper div. When react-dropzone v14 falls back to a hidden <input> (any
non-Chromium / non-secure-context browser), the input's native change event
bubbles to the div and invokes the handler with a SyntheticEvent instead of a
file array, throwing "Invalid attempt to spread non-iterable instance" and
blanking the inbound Send page and every import flow.
Destructure onChange out of the spread so it no longer lands on the div.
Relates to openboxes#6031
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Description of Change
Link to GitHub issue or Jira ticket: Fixes #6031
Description:
Document upload is broken in Firefox and Safari (and in any browser served over plain HTTP), in two places with the same root cause.
react-dropzonev14 only uses the File System Access API in a secure-context Chromium browser (window.isSecureContext && 'showOpenFilePicker' in window); everywhere else it falls back to a hidden<input>, and two components don't handle that fallback correctly.1. Outbound / combined-shipments Send page — clicking upload does nothing
outbound/SendMovementPage.jsxandcombined-shipments/SendMovementPage.jsxrender the dropzone render-prop without<input {...getInputProps()} />, soopen()has no input to trigger. The legacyinbound/SendMovementPage.jsxalready renders it and works; this adds the same two lines to the other two.2. DropzoneFileSelect — crash after selecting a file
DropzoneFileSelect.jsxkeptonChangeinside{...fieldProps}and spread it onto the wrapper<div>. When the fallback<input>fires its native change event, it bubbles to the div and calls the handler with aSyntheticEventinstead of a file array, throwingInvalid attempt to spread non-iterable instanceand blanking the inbound V2 Send page and every import flow (outbound import, location/category/bin import). Fixed by destructuringonChangeout of the spread so it no longer lands on the div.Both paths work in secure-context Chrome because react-dropzone uses the File System Access API there and never touches the input fallback, which is why this is easy to miss in dev.
📷 Screenshots & Recordings
Before recording attached in the issue.
Fix:
2026-07-16.16-11-59.mp4