fixes #1315 filter on tags no longer cares about case

* searching "Pa" will find both "Pasta" and "pasta"
* the searched word can be "included" in the result, not only "starting with". "ta" will find "pasta".

Thanks to @dawsk-2021 in issue #1320
This commit is contained in:
plegall
2021-02-05 09:35:51 +01:00
parent a9f4449f4b
commit 82f6371955

View File

@@ -795,9 +795,9 @@ function isSearched(tagBox, stringSearch) {
}
function isDataSearched(tagObj) {
let name = tagObj.name;
let name = tagObj.name.toLowerCase();
let stringSearch = $("#search-tag .search-input").val();
if (name.startsWith(stringSearch.toLowerCase())) {
if (name.includes(stringSearch.toLowerCase())) {
return true;
} else {
return false;