Skip to content

Commit

Permalink
Added ability to filter to partial match on either start or end of fi…
Browse files Browse the repository at this point in the history
…lter string.
  • Loading branch information
patcon committed Nov 9, 2024
1 parent 422ff69 commit 3ede039
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ if (search) {
return
}

// Allow matching when fragment.
// E.g., "fin" will match any of "finland", of "digifinland"
//
// TODO: Fix this so it works with multiple words.
// E.g., "test finland" filters differently than "finland test"
if (!searchValue.endsWith('*')) {
searchValue = `${searchValue} ${searchValue}*`
searchValue = `${searchValue} *${searchValue}*`
}

try {
Expand Down

0 comments on commit 3ede039

Please sign in to comment.