File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed
Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { given_icon_name_return_html_string } from " $lib/utils/icons" ;
33 import { bigram_search , linear_search } from " $lib/utils/search" ;
4- import { onMount } from " svelte" ;
54 import { toasts_store } from " $lib/components/ui/toast/toast.svelte" ;
65 import { browser } from " $app/environment" ;
76 import Header from " $lib/components/header.svelte" ;
109
1110 let icons_json = $state <Icon [] | null >(null );
1211 let icons = $state <Icon [] | null >(null );
13- let search_input_el = $state <HTMLInputElement | null >(null );
1412
1513 $effect .pre (() => {
1614 import (" $lib/icons.json" , {
2321 });
2422 });
2523
26- onMount (() => {
27- search_input_el ?.focus ();
28- });
29-
3024 function handle_input(event : Event ) {
3125 if (icons_json == null ) return ;
3226
8074 <div class =" search-container" >
8175 <coreicons-shape-search class =" icon" ></coreicons-shape-search >
8276 <input
77+ placeholder =" Search icons..."
8378 oninput ={(event ) => {
8479 event .preventDefault ();
8580 handle_input (event );
8681 }}
87- placeholder =" Search icons..."
88- bind:this ={search_input_el }
8982 />
9083 </div >
9184 <div class =" icons-grid-container" >
You can’t perform that action at this time.
0 commit comments