fix(frontend): search icons by prefix, not contains
This commit is contained in:
parent
cd8f165a17
commit
b4501f5ede
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,12 @@
|
||||||
|
|
||||||
let searchBox = "";
|
let searchBox = "";
|
||||||
let filteredIcons: string[] = [];
|
let filteredIcons: string[] = [];
|
||||||
$: filteredIcons = searchBox ? icons.filter((icon) => icon.includes(searchBox)).slice(0, 15) : [];
|
$: filteredIcons = searchBox
|
||||||
|
? icons
|
||||||
|
.filter((icon) => icon.startsWith(searchBox))
|
||||||
|
.sort()
|
||||||
|
.slice(0, 15)
|
||||||
|
: [];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<InputGroup class="m-1">
|
<InputGroup class="m-1">
|
||||||
|
|
Loading…
Reference in a new issue