From 6435844f5a47a215d3c07fa2b10d47b16815c9a2 Mon Sep 17 00:00:00 2001 From: Joseph Lwanzo Khausi Date: Tue, 16 Sep 2025 23:52:38 +0200 Subject: [PATCH] fix(frontend): add explicit handler for search form submission to prevent double-click issues --- modules/core/js_modules/route_handlers.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/core/js_modules/route_handlers.js b/modules/core/js_modules/route_handlers.js index 8460c55f9..678be67b1 100644 --- a/modules/core/js_modules/route_handlers.js +++ b/modules/core/js_modules/route_handlers.js @@ -93,6 +93,21 @@ function applySearchPageHandlers(routeParams) { $('.search_reset').on("click", Hm_Utils.reset_search_form); $('.combined_sort').on("change", function() { Hm_Message_List.sort($(this).val()); }); + // Add explicit handler for search form submission to fix double-click issue + $('.search_update').on("click", function(e) { + e.preventDefault(); + const form = $(this).closest('form'); + if (form.length) { + const formData = new FormData(form[0]); + const params = new URLSearchParams(); + for (let [key, value] of formData.entries()) { + params.append(key, value); + } + const newUrl = window.location.pathname + '?' + params.toString(); + window.location.href = newUrl; + } + }); + performSearch(routeParams); if (window.inlineMessageMessageListAndSearchPageHandler) inlineMessageMessageListAndSearchPageHandler(routeParams);