Skip to content

Commit

Permalink
Merge pull request #199 from azmeuk/sort-empty
Browse files Browse the repository at this point in the history
Call custom ordering functions when opening the menu with an empty input
  • Loading branch information
pstanoev committed Jun 20, 2023
2 parents 0f59818 + 732a39e commit c1fac73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SimpleAutocomplete.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
return numberOfMatches(obj2, searchWords) - numberOfMatches(obj1, searchWords)
}
function processListItems(textFiltered) {
function processListItems(textFiltered="") {
// cleans, filters, orders, and highlights the list items
prepareListItems()
Expand Down Expand Up @@ -871,7 +871,7 @@
if (searchFunction && !listItems.length) {
search()
} else if (!text) {
filteredListItems = listItems
processListItems()
}
open()
Expand Down

0 comments on commit c1fac73

Please sign in to comment.