From 09c38446c39b1f96d86febefb6460faaa337d997 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 e115627c..46835e89 100644 --- a/appview/pages/templates/fragments/comment/reply.html +++ b/appview/pages/templates/fragments/comment/reply.html @@ -5,7 +5,6 @@ hx-swap="none" hx-trigger="submit, keydown[(ctrlKey || metaKey) && key=='Enter'] from:find textarea" hx-on::before-request="this.querySelector('#comment-error').innerHTML = ''" - 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 9dff87f3..cc6a680b 100644 --- a/appview/pages/templates/repo/issues/fragments/newComment.html +++ b/appview/pages/templates/repo/issues/fragments/newComment.html @@ -6,7 +6,7 @@ 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::before-request="document.getElementById('comment-error').innerHTML = ''" - 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 496f99dc..6eb0e7fd 100644 --- a/appview/pages/templates/repo/pulls/fragments/pullNewComment.html +++ b/appview/pages/templates/repo/pulls/fragments/pullNewComment.html @@ -7,7 +7,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()" > diff --git a/appview/pages/templates/strings/string.html b/appview/pages/templates/strings/string.html index 20c4c878..0029cc4f 100644 --- a/appview/pages/templates/strings/string.html +++ b/appview/pages/templates/strings/string.html @@ -118,7 +118,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