Skip to content

Commit

Permalink
add autocomplete feature
Browse files Browse the repository at this point in the history
  • Loading branch information
E-Sh4rk committed Sep 22, 2024
1 parent 272d2f4 commit e4bb8d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion html/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ document.addEventListener('DOMContentLoaded', () => {
return;
}

const matches = suggestions.filter((suggestion) => /*suggestion.indexOf(currentWord) > -1*/ suggestion.toLowerCase().startsWith(currentWord.toLowerCase()));
const matches = suggestions.filter((suggestion) =>
suggestion.toLowerCase().startsWith(currentWord.toLowerCase()) || parseInt(currentWord) === pkmn_data_map[suggestion]);
if (matches.length === 0) {
suggestionsEle.style.display = 'none';
return;
Expand Down

0 comments on commit e4bb8d4

Please sign in to comment.