-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix strange UI behavior of cancelling dismiss review modal #25133
Conversation
869d690
to
b8e4920
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed as fixed.
…25133) Fixes go-gitea#25130 The old code uses `$(this).next()` to get `dismiss-review-modal`. At first, it will get `$(#dismiss-review-modal)`, but the next time it will get `$(#dismiss-review-modal).next();` and then `$(#dismiss-review-modal).next().next();`. Because div `dismiss-review-modal` will be removed when `dismiss-review-btn` clicked. Maybe the right usage is adding `show-modal` class and `data-modal` attribute.
{{svg "octicon-x" 20}} | ||
</a> | ||
<div class="ui small modal" id="dismiss-review-modal"> | ||
<div class="ui small modal dismiss-review-modal" id="dismiss-review-modal"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is wrong.
You are using the same id="dismiss-review-modal"
in a range
loop
Please revert or fix ASAP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id is not introduced by this PR so we can send a new PR to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ID was never used.
But this PR uses it by data-modal="#dismiss-review-modal"
.
Then which modal
does it refer to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is inside range
there will be multiple iterations but HTML ids must be unique in the whole page. I think the solution is to move the modal outside the range
as there can effectively only be one visible at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a quick fix, I think it can be combined with a ID, like #dismiss-review-modal-{{.Review.ID}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems like a good temporary solution. The modal depends on .Review.ID
so can not be easily be moved outside the loop as-is.
* main: Modify OAuth login ui and fix display name, iconurl related logic (go-gitea#25030) Fix open redirect check for more cases (go-gitea#25143) Update js dependencies (go-gitea#25137) Remove duplicated functions when deleting a branch (go-gitea#25128) Add codeowners feature (go-gitea#24910) Fix strange UI behavior of cancelling dismiss review modal (go-gitea#25133) Fix `MilestoneIDs` when querying issues (go-gitea#25125) Fix incorrect git ignore rule and add missing license files (go-gitea#25135) Change branch name from master to main in some documents' links (go-gitea#25126) Remove incorrect element ID on "post-install" page (go-gitea#25104) [skip ci] Updated translations via Crowdin Improve notification icon and navbar (go-gitea#25111) fix swagger documentation for multiple files API endpoint (go-gitea#25110)
* upstream/main: [skip ci] Updated translations via Crowdin Modify OAuth login ui and fix display name, iconurl related logic (go-gitea#25030) Fix open redirect check for more cases (go-gitea#25143) Update js dependencies (go-gitea#25137) Remove duplicated functions when deleting a branch (go-gitea#25128) Add codeowners feature (go-gitea#24910) Fix strange UI behavior of cancelling dismiss review modal (go-gitea#25133) Fix `MilestoneIDs` when querying issues (go-gitea#25125) Fix incorrect git ignore rule and add missing license files (go-gitea#25135) Change branch name from master to main in some documents' links (go-gitea#25126) Remove incorrect element ID on "post-install" page (go-gitea#25104) [skip ci] Updated translations via Crowdin Improve notification icon and navbar (go-gitea#25111) fix swagger documentation for multiple files API endpoint (go-gitea#25110) Fix webauthn regression and improve code (go-gitea#25113) Add details summary for vertical menus in settings to allow toggling (go-gitea#25098) Fix 500 error caused by notifications without an issue such as repo transfers (go-gitea#25101)
Fix #25133 Thanks @wxiaoguang @silverwind. I'm sorry I made a mistake, it will be fixed in this PR. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: silverwind <me@silverwind.io>
…25133) Fixes go-gitea#25130 The old code uses `$(this).next()` to get `dismiss-review-modal`. At first, it will get `$(#dismiss-review-modal)`, but the next time it will get `$(#dismiss-review-modal).next();` and then `$(#dismiss-review-modal).next().next();`. Because div `dismiss-review-modal` will be removed when `dismiss-review-btn` clicked. Maybe the right usage is adding `show-modal` class and `data-modal` attribute.
Fix go-gitea#25133 Thanks @wxiaoguang @silverwind. I'm sorry I made a mistake, it will be fixed in this PR. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: silverwind <me@silverwind.io>
* upstream/main: [skip ci] Updated licenses and gitignores Add `WithPullRequest` for `actionsNotifier` (go-gitea#25144) [skip ci] Updated translations via Crowdin [skip ci] Updated translations via Crowdin Update github.com/google/go-github to v53 (go-gitea#25157) Fix bug for code search if code is disabled (go-gitea#25173) Minor arc-green color tweaks (go-gitea#25175) Fix duplicate Reviewed-by trailers (go-gitea#24796) Fix go-gitea#25133 (go-gitea#25162) Fix mobile navbar and misc cleanups (go-gitea#25134) Button and color enhancements (go-gitea#24989) Fix setup-go actions (go-gitea#25167) # Conflicts: # templates/base/head_navbar.tmpl
Fixes #25130
The old code uses
$(this).next()
to getdismiss-review-modal
.At first, it will get
$(#dismiss-review-modal)
, but the next time it will get$(#dismiss-review-modal).next();
and then
$(#dismiss-review-modal).next().next();
.Because div
dismiss-review-modal
will be removed whendismiss-review-btn
clicked.Maybe the right usage is adding
show-modal
class anddata-modal
attribute.