From 524ea195770efb57f3ea28e316c521acf7874721 Mon Sep 17 00:00:00 2001 From: Jason Rothacker Date: Thu, 26 Dec 2024 09:08:27 -0800 Subject: [PATCH] [Bug] Fix fac.gov search on audit search page (#4563) * [Bug] Fix fac.gov search on audit search page * [Bug] Fix fac.gov search on audit search page Use the id from the submit button to avoid adding on-click listeners for searches. --- backend/static/js/search-results.js | 4 ++++ backend/templates/includes/nav_primary.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/static/js/search-results.js b/backend/static/js/search-results.js index 34c304eccb..4ce4ddc1bb 100644 --- a/backend/static/js/search-results.js +++ b/backend/static/js/search-results.js @@ -153,6 +153,10 @@ function attachEventHandlersSorting() { */ function attachEventHandlersSubmission() { search_submit_buttons.forEach((button) => { + + // The first search button is always for searching all of fac.gov, we want to ignore that one hence skipping. + if (button.id === 'fac-search') return; + button.addEventListener('click', () => { // The arrow won't be there if results were previously populated if (search_arrow) { diff --git a/backend/templates/includes/nav_primary.html b/backend/templates/includes/nav_primary.html index 4cdd32359b..b746ce3990 100644 --- a/backend/templates/includes/nav_primary.html +++ b/backend/templates/includes/nav_primary.html @@ -149,7 +149,7 @@ Search -