Skip to content

Commit

Permalink
feat(autocomplete): add "no results" state (#2361)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen authored Feb 5, 2025
1 parent 25af2d0 commit c438bb8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion assets/ts/ui/autocomplete/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@ export const locationSource = (
templates: {
item: urlType
? templateWithLink(LocationItemTemplate)
: LocationItemTemplate
: LocationItemTemplate,
noResults({ html }) {
return html`
<i
class="fa fa-fw fa-circle-exclamation text-firebrick-50 mr-sm"
aria-hidden="true"
></i>
No results found
`;
}
},
getItems() {
return fetch(`/places/search/${encodeURIComponent(query)}/${number}`)
Expand Down

0 comments on commit c438bb8

Please sign in to comment.