[bugfix] clear the notfound message on new search

This commit is contained in:
2026-03-08 00:03:25 -05:00
parent 4eed1869a6
commit f5fcd7b3e7
2 changed files with 2 additions and 21 deletions

View File

@@ -2,27 +2,6 @@
import '/src/assets/css/main.scss'; import '/src/assets/css/main.scss';
export const prerender = false; export const prerender = false;
--- ---
<script is:inline>
const afterUpdate = (e) => {
const start = document.querySelector('#start');
if (start) {
const val = Number(start.value) || 0;
start.value = (val + 20).toString();
}
// delete the triggering element
if (e && e.detail && e.detail.elt) {
e.detail.elt.remove();
}
};
const beforeSearch = (e) => {
const start = document.querySelector('#start');
if (start) {
start.value = '0';
document.querySelector('#cardGrid').innerHTML = '';
window.scrollTo({ top: 0, behavior: 'instant' });
}
};
</script>
<nav class="navbar navbar-expand sticky-top bg-dark" data-bs-theme="dark"> <nav class="navbar navbar-expand sticky-top bg-dark" data-bs-theme="dark">
<div class="container container-fluid"> <div class="container container-fluid">
<a class="navbar-brand d-flex" href="/"> <a class="navbar-brand d-flex" href="/">

View File

@@ -14,6 +14,8 @@ import { Show } from '@clerk/astro/components'
} }
}; };
const beforeSearch = (e) => { const beforeSearch = (e) => {
const notfound = document.getElementById('notfound');
if (notfound) notfound.innerHTML = '';
const start = document.querySelector('#start'); const start = document.querySelector('#start');
if (start) { if (start) {
start.value = '0'; start.value = '0';