Skip to content

Commit

Permalink
ignore umlauts/diacritics during account filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
powerpaul17 committed Jun 28, 2024
1 parent 4cd5ed6 commit 24ad2b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions src/components/AccountSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
"
Expand Down Expand Up @@ -165,4 +164,11 @@
return a1.type - a2.type;
});
});
function normalizeSearchString(str: string): string {
return str
.toLocaleLowerCase()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '');
}
</script>

0 comments on commit 24ad2b6

Please sign in to comment.