Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Restore collator options
Browse files Browse the repository at this point in the history
jughosta committed Nov 23, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b52f10a commit 3cf67e4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -332,8 +332,11 @@ export function useGroupedFields<T extends FieldListItem = DataViewField>({
}, [fieldGroups, scrollToTopResetCounter, fieldsExistInIndex, fieldsExistenceStatus]);
}

const collator = new Intl.Collator(undefined, {
sensitivity: 'base',
});
function sortFields<T extends FieldListItem>(fieldA: T, fieldB: T) {
return (fieldA.displayName || fieldA.name).localeCompare(fieldB.displayName || fieldB.name);
return collator.compare(fieldA.displayName || fieldA.name, fieldB.displayName || fieldB.name);
}

function hasFieldDataByDefault(): boolean {

0 comments on commit 3cf67e4

Please sign in to comment.