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

Merged
merged 6 commits into from
Jul 26, 2025

Conversation

bartvdbraak
Copy link
Contributor

@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 <[email protected]>
Signed-off-by: wxiaoguang <[email protected]>
Signed-off-by: wxiaoguang <[email protected]>
Signed-off-by: wxiaoguang <[email protected]>
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
Contributor 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
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 26, 2025
@lunny lunny merged commit 82c9589 into go-gitea:main Jul 26, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Jul 26, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 26, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jul 27, 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 go-gitea#35125

---------

Co-authored-by: wxiaoguang <[email protected]>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Jul 27, 2025
lafriks pushed a commit that referenced this pull request Jul 27, 2025
Backport #35156 by @bartvdbraak

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

Co-authored-by: Bart van der Braak <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 28, 2025
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Fix migrate input box bug (go-gitea#35166)
  [skip ci] Updated translations via Crowdin
  Only hide dropzone when no files have been uploaded (go-gitea#35156)
  Change some columns from text to longtext and fix column wrong type caused by xorm (go-gitea#35141)
  [skip ci] Updated translations via Crowdin
  Add `owner` and `parent` fields clarification to docs (go-gitea#35023)
  Improve language in en-US locale strings (go-gitea#35124)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created 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