Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related to ParthJadhav#25. Search results flickers because of three things (IMO): - `handleInput` resets the `results` array, which immediately dropping list with `#if` directive in `SearchResult` component - Changing styles on `focus` and `blur` are not immediate operation, that's why another kind of flickering is a transition between focused and non-focused state (gray background) - `getIcon` function is another "bottleneck"; preservation of space for upcomming <img> tag is a key for rescue Most "ugly" part of this code is manipulating with classes. Changing classes through Svelte's `class:` binding leads to focus lost. Unfortunately, manipulating classes through script cannot be made with obfuscated selectors, that's why you can see `:global` in code. Maybe you know better way to change classes without losing focus.
- Loading branch information