The search box learns Turkish — ı and İ find their own
Browse files at this commit125a1f6cdf5b48ad730d33291481a408c082f20eParent: d80fd9e- fix
- the search box learns Turkish — ı and İ find their own
1 changed file +5 -2
crates/izlek-web/src/dropdown.rsmodified+5 -2
| @@ -64,9 +64,12 @@ pub async fn dropdown_script(cx: &Cx) -> Result { | |||
| 64 | search.dispatchEvent(new Event('input', { bubbles: true }));\ | 64 | search.dispatchEvent(new Event('input', { bubbles: true }));\ |
| 65 | }\ | 65 | }\ |
| 66 | function filterRows(panel, query) {\ | 66 | function filterRows(panel, query) {\ |
| 67 | - var q = query.toLowerCase();\ | 67 | + var qTr = query.toLocaleLowerCase('tr');\ |
| 68 | + var qEn = query.toLowerCase();\ | ||
| 68 | panel.querySelectorAll('.dd-option').forEach(function (r) {\ | 69 | panel.querySelectorAll('.dd-option').forEach(function (r) {\ |
| 69 | - r.classList.toggle('dd-option-hidden', q !== '' && r.textContent.toLowerCase().indexOf(q) === -1);\ | 70 | + var t = r.textContent;\ |
| 71 | + var miss = t.toLocaleLowerCase('tr').indexOf(qTr) === -1 && t.toLowerCase().indexOf(qEn) === -1;\ | ||
| 72 | + r.classList.toggle('dd-option-hidden', qEn !== '' && miss);\ | ||
| 70 | });\ | 73 | });\ |
| 71 | var vis = visibleRows(panel);\ | 74 | var vis = visibleRows(panel);\ |
| 72 | activate(panel, panel.querySelector('.dd-option-selected:not(.dd-option-hidden)') || vis[0]);\ | 75 | activate(panel, panel.querySelector('.dd-option-selected:not(.dd-option-hidden)') || vis[0]);\ |