diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dc5b7e..f11fc6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Implement audit logging - Save collapsed state of book navigation items +### Changed + +- Improve account filtering + ## [0.26.6] - 2024-06-10 ### Changed diff --git a/src/components/AccountSelect.vue b/src/components/AccountSelect.vue index 30a9942..cee689a 100644 --- a/src/components/AccountSelect.vue +++ b/src/components/AccountSelect.vue @@ -7,12 +7,11 @@ :disabled="!editable" :append-to-body="true" :filter-by=" - (option, label, search) => { + (option, label, search: string) => { return ( - [label, option.description] - .join(' ') - .toLocaleLowerCase() - .indexOf(search.toLocaleLowerCase()) >= 0 + normalizeSearchString([label, option.description].join(' ')).indexOf( + normalizeSearchString(search) + ) >= 0 ); } " @@ -165,4 +164,11 @@ return a1.type - a2.type; }); }); + + function normalizeSearchString(str: string): string { + return str + .toLocaleLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, ''); + }