summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/comp/QuickSubmit.js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-04-27 22:32:00 +0800
committerGitHub <noreply@github.com>2024-04-27 14:32:00 +0000
commit8de2992ffba8cc627757ecea1e002a55581113d2 (patch)
tree0ac56412f0686ae8c53e8ab1ef8d389c8cb751ae /web_src/js/features/comp/QuickSubmit.js
parent6d2a307ad8af7d686f1c3a3706ff0f2df895658a (diff)
downloadgitea-1.22.0-rc1.tar.gz
gitea-1.22.0-rc1.zip
Make Ctrl+Enter work for issue/comment edit (#30720)v1.22.0-rc1
Fix #30710
Diffstat (limited to 'web_src/js/features/comp/QuickSubmit.js')
-rw-r--r--web_src/js/features/comp/QuickSubmit.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/web_src/js/features/comp/QuickSubmit.js b/web_src/js/features/comp/QuickSubmit.js
index 477b3b9e2a..6bd5f6644d 100644
--- a/web_src/js/features/comp/QuickSubmit.js
+++ b/web_src/js/features/comp/QuickSubmit.js
@@ -1,5 +1,5 @@
export function handleGlobalEnterQuickSubmit(target) {
- const form = target.closest('form');
+ let form = target.closest('form');
if (form) {
if (!form.checkValidity()) {
form.reportValidity();
@@ -9,5 +9,10 @@ export function handleGlobalEnterQuickSubmit(target) {
// here use the event to trigger the submit event (instead of calling `submit()` method directly)
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true}));
+ return;
+ }
+ form = target.closest('.ui.form');
+ if (form) {
+ form.querySelector('.ui.primary.button')?.click();
}
}