V15: Dropzone single mode should only allow one file at a time#18847
Merged
iOvergaard merged 1 commit intov15/devfrom Mar 27, 2025
Merged
V15: Dropzone single mode should only allow one file at a time#18847iOvergaard merged 1 commit intov15/devfrom
iOvergaard merged 1 commit intov15/devfrom
Conversation
…is in progress you need to clear the files/queue before trying to upload something else, unless multiple=true
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the dropzone behavior in single file mode so that a new file cannot be added while an upload is in progress.
- Introduces a new private getter (#isDisabled) to centralize the logic determining whether the dropzone should accept uploads.
- Updates event handlers and UI bindings to use the new disabled state and adjusts styling accordingly.
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/src/packages/media/dropzone/components/input-dropzone/input-dropzone.element.ts:83
- Consider adding unit tests for the new #isDisabled getter to ensure that it correctly identifies when the dropzone should be disabled, especially in cases where an upload is pending with multiple=false.
get #isDisabled(): boolean {
leekelleher
approved these changes
Mar 27, 2025
This was referenced Sep 28, 2025
This was referenced Oct 23, 2025
This was referenced Oct 23, 2025
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
It is currently possible to drag another file over a "single-mode" dropzone whilst an upload is pending because the multiple property is only sent to the internal dropzone as
?multiple, meaning that only one file could be selected at a time. However, we would like its behavior to reflect thatmultiple = falsemeans only one file ever can be uploaded, unless you clear that file.This disables the internal dropzone if
multiple = falseand an upload is in progress. You need to clear the files/queue before trying to upload something else, unless multiple=true.A bonus feature is that we allow to show the "uploader UI" to be shown even though the dropzone is disabled, because otherwise the files would be hidden.
How to test
Caveat
One thought is that if a previous upload is in a non-complete state, then we would allow a second file to be uploaded. It could be that you had cancelled a file or its type was ultimately not accepted. I would like an opinion on that.