uppy: autoOpenFileEditor option is ignored (broken?) past @uppy/dashboard 3.7.4 and @uppy/react
Initial checklist
- I understand this is a bug report and questions should be posted in the Community Forum
- I searched issues and couldn’t find anything (or linked relevant results below)
Link to runnable example
https://codesandbox.io/p/sandbox/ecstatic-wilbur-vk6krr
Steps to reproduce
- Visit page
- Click “Browse files” and select an image
- See results
Expected behavior
- The crop/edit tool should open immediately because
autoOpenFileEditoris specified. This worked in previous versions.
Actual behavior
- The preview and rename dialog shows with an “Edit image” button. The user can click “Edit image” to bring up the editor.
This started after upgrading my dependencies this morning.
Previous, including some likely unrelated packages to be thorough:
"@uppy/core": "^3.8.0",
"@uppy/dashboard": "^3.7.1",
"@uppy/drag-drop": "^3.0.3",
"@uppy/file-input": "^3.0.4",
"@uppy/image-editor": "^2.4.0",
"@uppy/progress-bar": "^3.0.4",
"@uppy/react": "^3.2.1",
Now:
"@uppy/core": "^3.9.3",
"@uppy/dashboard": "^3.7.5",
"@uppy/drag-drop": "^3.0.3",
"@uppy/file-input": "^3.1.0",
"@uppy/image-editor": "^2.4.4",
"@uppy/progress-bar": "^3.1.0",
"@uppy/react": "^3.2.2",
If I revert to @uppy/dashboard@3.7.3, it works as it used to. It seems like a bug but if it was intention, it’s a major breaking change as I rely on this behavior to enforce aspect ratios of many images.
I did some exploration of versions and traced this back to @uppy/dashboard 3.7.4. In other words, the following works:
"@uppy/core": "^3.9.3",
"@uppy/dashboard": "3.7.3",
"@uppy/drag-drop": "^3.0.3",
"@uppy/file-input": "^3.1.0",
"@uppy/image-editor": "^2.4.4",
"@uppy/progress-bar": "^3.1.0",
"@uppy/react": "3.2.1",
@uppy/react 3.2.2 has a peer dependency on @uppy/dashboard 3.7.5 so I can’t update it past there.
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 16 (12 by maintainers)
In my case, I use use events to control the behavior:
This will not help @jbpros because of the Metadata requirement; however, if new events wind up being added then perhaps they will provide the tools needed to control each step of the process.
I just opened the PR for the config option. I started working on events and it’s a bit more tangled than I was comfortable with. In my quick review it looks like it would benefit from a bit of untangling and reworking that I’d consider breaking changes.
Current events:
dashboard:file-edit-startfires only when the meta editor starts because it’s part of thetoggleFileCardmethoddashboard:file-edit-completefires only when the image editor endsThe wording for both suggests image editor, just like the
autoOpenfileEditor, the language suggests the same things, but they are describing different events.Rather than changing these events, which will cause breaking changes, can we consider adding three new pairs of events that are more specific and accurate?
dashboard:meta-editor-startshould fire specifically when editing metadatadashboard:meta-editor-completeshould fire specifically when done editing metadata, ideally with an argument indicating whether it was submitted or cancelled.dashboard:image-editor-startshould fire specifically when editing the imagedashboard:image-editor-endshould fire specifically when done editing the image, ideally with an argument indicating whether it was submitted or cancelleddashboard:editor-startshould fire when the card first appearsdashboard:editor-endshould fire when the card closesThen leave the existing events alone, possibly deprecate them and stop using them in a future major release, RIP. I’ll also add that I am currently using
dashboard:file-edit-completeto immediately save changes once editing is complete, so I have a personal stake in not changing in a patch release or it will break my app. 🙏 🙏 🙏