From a7bdb005f48eedd8744dad1a7b2cd1db1d562440 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Mon, 18 May 2026 18:55:56 +0000 Subject: [PATCH] fix: use htmx.trigger instead of dispatchEvent for HTMX swap dispatchEvent(submit) was triggering native form submission (full page reload). htmx.trigger() properly triggers HTMX swap. Also re-enable initial rebindEventLayers so polygons load on first render. --- src/central/gui/templates/events_list.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/central/gui/templates/events_list.html b/src/central/gui/templates/events_list.html index 2ed1868..5c00b94 100644 --- a/src/central/gui/templates/events_list.html +++ b/src/central/gui/templates/events_list.html @@ -239,9 +239,7 @@ southInput.value = bounds.getSouth().toFixed(4); eastInput.value = bounds.getEast().toFixed(4); westInput.value = bounds.getWest().toFixed(4); - document.getElementById("filter-form").dispatchEvent( - new Event("submit", { bubbles: true }) - ); + htmx.trigger(document.getElementById("filter-form"), "submit"); } function buildPopup(row) { @@ -417,7 +415,7 @@ document.getElementById("fit-to-results").addEventListener("click", fitToAllLayers); // Initial load - bind layers and fit bounds - // rebindEventLayers(); // DISABLED: map shows all events, only table filters + rebindEventLayers(); // Initial load only if (false) { // DISABLED: map never auto-fits fitToAllLayers(); isInitialLoad = false;