[bugfix] reset form start to zero on new query

This commit is contained in:
2026-02-23 09:13:18 -05:00
parent e914e50096
commit 07ad118041

View File

@@ -13,11 +13,17 @@
e.detail.elt.remove();
}
};
const beforeSearch = (e) => {
const start = document.querySelector('#start');
if (start) {
start.value = '0';
}
};
</script>
<div class="sticky border-bottom">
<div class="container">
<form id="searchform" hx-post="/partials/cards" hx-target="#cardGrid" hx-trigger="load, submit" hx-vals='{"start":"0"}' hx-on--after-request="afterUpdate()">
<form id="searchform" hx-post="/partials/cards" hx-target="#cardGrid" hx-trigger="load, submit" hx-vals='{"start":"0"}' hx-on--after-request="afterUpdate()" hx-on--before-request="beforeSearch()">
<div class="d-flex justify-content-between">
<div class="my-2 flex-grow-1 me-2">
<input type="hidden" name="start" id="start" value="0" />