fixed: search in list accent insensitive
This commit is contained in:
parent
f17eb11afc
commit
9cb6080cf7
7
main.js
7
main.js
|
@ -2249,11 +2249,16 @@ function ontitlechange()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function simplifystring(str)
|
||||||
|
{
|
||||||
|
return str.toLowerCase().normalize('NFD').replace(/\p{Diacritic}/gu, "");
|
||||||
|
}
|
||||||
|
|
||||||
function applyfilter()
|
function applyfilter()
|
||||||
{
|
{
|
||||||
[...filteredlist.children].forEach(div =>
|
[...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;
|
fileindex = 0;
|
||||||
|
|
Loading…
Reference in New Issue