Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/core/js_modules/route_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.search_update is a submit button. We shouldn't need to emulate its behaviour of form submission. The proper fix here would be to find the reason why clicking it one time doesn't submit the form and fix that - probably other event handlers kicking in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug seems to be fixed since yesterday. I am looking for the recent PR to identify the fix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Expand Down
Loading