From c596262cac5dc64591b231f10ccb76aae54c5a0e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 19 Jan 2026 15:58:12 +0100 Subject: [PATCH] Small fixes for #3778 --- changedetectionio/static/js/search-modal.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/changedetectionio/static/js/search-modal.js b/changedetectionio/static/js/search-modal.js index ecd34c9b4..a55dab3b6 100644 --- a/changedetectionio/static/js/search-modal.js +++ b/changedetectionio/static/js/search-modal.js @@ -69,6 +69,19 @@ } }); + // Handle Enter key in search input + if (searchInput) { + searchInput.addEventListener('keydown', function(e) { + if (e.key === 'Enter') { + e.preventDefault(); + if (searchForm) { + // Trigger form submission programmatically + searchForm.dispatchEvent(new Event('submit')); + } + } + }); + } + // Handle form submission if (searchForm) { searchForm.addEventListener('submit', function(e) { @@ -88,8 +101,8 @@ params.append('tags', tags); } - // Navigate to search results - window.location.href = '?' + params.toString(); + // Navigate to search results (always redirect to watchlist home) + window.location.href = '/?' + params.toString(); }); } });