chore: remove url param if the input was cleared

This commit is contained in:
David Ho 2024-01-27 20:35:03 +08:00
parent 5053dc18b3
commit cd748a8657
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@
// Search svgs:
const searchSvgs = () => {
$searchParam = searchTerm;
$searchParam = searchTerm || null;
loadSvgs();
filteredSvgs = allSvgs.filter((svg: iSVG) => {
let svgTitle = svg.title.toLowerCase();

View File

@ -28,7 +28,7 @@
}
const searchSvgs = () => {
$searchParam = searchTerm;
$searchParam = searchTerm || null;
return (filteredSvgs = svgsByCategory.filter((svg: iSVG) => {
let svgTitle = svg.title.toLowerCase();
return svgTitle.includes(searchTerm.toLowerCase());