Skip to content

Only hide dropzone when no files have been uploaded #35156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bartvdbraak
Copy link

@bartvdbraak bartvdbraak commented Jul 24, 2025

Instead of always hiding the dropzone when it's not active:

  • hide it when when there are no uploaded files and it becomes inactive
  • don't hide it when there are uploaded files

Fixes #35125

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 24, 2025
@techknowlogick techknowlogick added type/bug topic/ui Change the appearance of the Gitea UI backport/v1.24 This PR should be backported to Gitea 1.24 labels Jul 24, 2025
blender-it pushed a commit to blender/gitea that referenced this pull request Jul 24, 2025
@bartvdbraak bartvdbraak requested a review from wxiaoguang July 25, 2025 09:58
blender-it pushed a commit to blender/gitea that referenced this pull request Jul 25, 2025
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some changes via GitHub online editor.

I think we do not need to tolerate "null/undefined" for this case: if ".form-field-dropzone" exists, then ".dropzone" must exists, then "el.dropzone" must exist. If any of them doesn't exist, there must be something (more serious) wrong.

@silverwind
Copy link
Member

silverwind commented Jul 25, 2025

Yeah, it's better to let the code crash than to hide bugs with ?. etc. In the first case we may get a bug report. In the second, it silently fails to work.

@bartvdbraak
Copy link
Author

Made some changes via GitHub online editor.

I think we do not need to tolerate "null/undefined" for this case: if ".form-field-dropzone" exists, then ".dropzone" must exists, then "el.dropzone" must exist. If any of them doesn't exist, there must be something (more serious) wrong.

Are there any changes that still need to be made here?

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 26, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue templates with multiple textareas have multiple file upload fields that can disappear
7 participants