⚙️ Add option to clear the search.

This commit is contained in:
pheralb
2023-07-10 15:52:47 +01:00
parent 9b576529ae
commit 465835bdb2
3 changed files with 25 additions and 0 deletions
+6
View File
@@ -28,6 +28,11 @@
return svgTitle.includes(searchTerm.toLowerCase());
}));
};
const clearSearch = () => {
searchTerm = '';
searchSvgs();
};
</script>
<svelte:head>
@@ -38,6 +43,7 @@
<Search
bind:searchTerm
on:input={searchSvgs}
clearSearch={() => clearSearch()}
placeholder={`Search ${filteredSvgs.length} logos...`}
/>
<Grid>
+6
View File
@@ -29,6 +29,11 @@
return svgTitle.includes(searchTerm.toLowerCase());
}));
};
const clearSearch = () => {
searchTerm = '';
searchSvgs();
};
</script>
<svelte:head>
@@ -39,6 +44,7 @@
<Search
bind:searchTerm
on:input={searchSvgs}
clearSearch={() => clearSearch()}
placeholder={`Search ${filteredSvgs.length} ${category} logos...`}
/>
<Grid>