From 932aa60efcfd5a3058f1f80c38183422b4616831 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sat, 23 May 2026 17:16:48 +0900 Subject: [PATCH] appview/pages: don't reset comment form after request This can catch `pages.Notice` responses which is not a successful request. We refresh the page on successful case, so it's fine to not refresh the form. Signed-off-by: Seongmin Lee --- appview/pages/templates/fragments/comment/reply.html | 1 - appview/pages/templates/repo/issues/fragments/newComment.html | 2 +- .../pages/templates/repo/pulls/fragments/pullNewComment.html | 1 - appview/pages/templates/strings/string.html | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/appview/pages/templates/fragments/comment/reply.html b/appview/pages/templates/fragments/comment/reply.html index 8b564b0d..16bf0ddc 100644 --- a/appview/pages/templates/fragments/comment/reply.html +++ b/appview/pages/templates/fragments/comment/reply.html @@ -4,7 +4,6 @@ hx-post="/comment" hx-swap="none" hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" - hx-on::after-request="if(event.detail.successful) this.reset()" hx-disabled-elt="find button[type='submit']" > {{ template "user/fragments/picHandleLink" .LoggedInUser.Did }} diff --git a/appview/pages/templates/repo/issues/fragments/newComment.html b/appview/pages/templates/repo/issues/fragments/newComment.html index 0641c134..e3ff9afe 100644 --- a/appview/pages/templates/repo/issues/fragments/newComment.html +++ b/appview/pages/templates/repo/issues/fragments/newComment.html @@ -4,7 +4,7 @@ hx-post="/comment" hx-trigger="submit, click from:#close-button, keydown[commentButtonEnabled() && (ctrlKey || metaKey) && key=='Enter'] from:#comment-textarea" hx-disabled-elt="find button[type='submit']" - hx-on::after-request="if(event.detail.successful) this.reset()" + hx-swap="none" class="group/form" > diff --git a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html index 4e93c95d..da9d75e6 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html +++ b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html @@ -8,7 +8,6 @@ hx-swap="none" hx-indicator="find button[type='submit']" hx-disabled-elt="find button[type='submit']" - hx-on::after-request="if(event.detail.successful) this.reset()" > diff --git a/appview/pages/templates/strings/string.html b/appview/pages/templates/strings/string.html index 9e02de7b..2d71ab2d 100644 --- a/appview/pages/templates/strings/string.html +++ b/appview/pages/templates/strings/string.html @@ -115,7 +115,6 @@ hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" hx-swap="none" hx-disabled-elt="find button[type='submit']" - hx-on::after-request="if(event.detail.successful) this.reset()" class="group/form" > -- 2.51.2