[bugfix] reset form start to zero on new query
This commit is contained in:
@@ -13,11 +13,17 @@
|
|||||||
e.detail.elt.remove();
|
e.detail.elt.remove();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const beforeSearch = (e) => {
|
||||||
|
const start = document.querySelector('#start');
|
||||||
|
if (start) {
|
||||||
|
start.value = '0';
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="sticky border-bottom">
|
<div class="sticky border-bottom">
|
||||||
<div class="container">
|
<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="d-flex justify-content-between">
|
||||||
<div class="my-2 flex-grow-1 me-2">
|
<div class="my-2 flex-grow-1 me-2">
|
||||||
<input type="hidden" name="start" id="start" value="0" />
|
<input type="hidden" name="start" id="start" value="0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user