fixed: search in list accent insensitive

This commit is contained in:
quenousimporte 2023-08-16 17:03:38 +02:00
parent f17eb11afc
commit 9cb6080cf7
1 changed files with 6 additions and 1 deletions

View File

@ -2249,11 +2249,16 @@ function ontitlechange()
}
}
function simplifystring(str)
{
return str.toLowerCase().normalize('NFD').replace(/\p{Diacritic}/gu, "");
}
function applyfilter()
{
[...filteredlist.children].forEach(div =>
{
div.hidden = div.textContent.toLowerCase().indexOf(filter.value.toLowerCase()) < 0;
div.hidden = simplifystring(div.textContent).indexOf(simplifystring(filter.value)) < 0;
});
fileindex = 0;