Closed zeddrix closed 2 years ago
This is supported in v4.1.0.
Use the "no-results" slot to render a message if a searched value does not yield any results.
<Typeahead {data} {extract} let:value>
<svelte:fragment slot="no-results">
No results found for "{value}"
</svelte:fragment>
</Typeahead>
Give it a try and LMK what you think.
Alright this is nice. Thanks! First of all, as a reminder for other folks who want to implement this too on their code, run npm i svelte-typeahead
again to have that v4.1.0.
And second, I didn't see the "No results found..." text because it's colored white. So to solve this, I needed to wrap the text with a paragraph tag:
<svelte:fragment slot="no-results">
<p style="color: black;">No results found.</p>
</svelte:fragment>
Thanks for implementing this. I hope we get to pick an icon for this search bar soon:)
And second, I didn't see the "No results found..." text because it's colored white.
Interesting; I'm unable to replicate this behavior. It should be inheriting the color from ancestor elements.
Thanks for implementing this. I hope we get to pick an icon for this search bar soon:)
PRs are always welcome.
Closed, right?
Hi, could you please have a feature where it says, "No results found" when results
ul
is empty for UX? Or even let us customize the message for that for the component?Also have like a search icon or let us have a custom icon at the left or maybe right side of the search box? Thank you very much. I'm using this package because it's cool and it's very close to React Semantic Ui's search box.