Ignore diacritics in autocomplete

Works for:
- Choice
- Choice List
- Reference
- Reference List

Co-Authored-By: Louis Delbosc <louis.delbosc.prestataire@anct.gouv.fr>
This commit is contained in:
Ronan Amicel
2022-08-09 15:43:44 +02:00
parent 103c795aa2
commit 2a05d04e35
6 changed files with 22 additions and 11 deletions

View File

@@ -8,7 +8,7 @@
*
* It is currently used for auto-complete in the ReferenceEditor and ReferenceListEditor widgets.
*/
import {ACIndex, ACIndexImpl} from 'app/client/lib/ACIndex';
import {ACIndex, ACIndexImpl, cleanText as clean} from 'app/client/lib/ACIndex';
import {ColumnCache} from 'app/client/models/ColumnCache';
import {UserError} from 'app/client/models/errors';
import {TableData} from 'app/client/models/TableData';
@@ -45,7 +45,7 @@ export class ColumnACIndexes {
const items: ICellItem[] = valColumn.map((val, i) => {
const rowId = rowIds[i];
const text = formatter.formatAny(val);
const cleanText = text.trim().toLowerCase();
const cleanText = clean(text);
return {rowId, text, cleanText};
});
items.sort(itemCompare);