I have an element
export function ResultHeader(props: {
loading: () => boolean;
searchItem: () => string;
results: () => string[];
header: () => string;
}) {
return (
<div class="result-header no-select">
<Switch fallback={props.header()}>
<Match when={props.loading()}>
<p>Looking up what beats "{props.searchItem()}"</p>
</Match>
<Match when={!props.searchItem()}>{null}</Match>
<Match when={!props.results().length}>
<p>No items found that beat "{props.searchItem()}"</p>
</Match>
</Switch>
</div>
);
}
but i somehow get in a state where i get both loading state and non-loading state. loading state should not appear
<div data-hk="s0000200" class="result-header no-select"><p>No items found that beat "<!--$-->hjkl<!--/-->"</p><p>Looking up what beats "<!--$-->hjkl<!--/-->"</p></div>
Reproduction steps:
- open website
- search for something that has uses, for example "rock"
- click on one of the results, for example "paper" to search for it
- search for something without results, for example "hjkl"
Then you can also search for something else ans you'll see top text get into a loading state and the to non-loading state with newly searched item, and bottom text will stay in loading state ith old item