Skip to content

Commit

Permalink
make sort case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Jul 26, 2022
1 parent 2ce5f5a commit 4e9b521
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ export const SpikeAnalysisTable: FC<SpikeAnalysisTableProps> = ({
const itemCount = changePoints?.length ?? 0;

let items: ChangePoint[] = changePoints ?? [];
items = sortBy(changePoints, (item) => item[sortField]);
items = sortBy(changePoints, (item) => {
if (item && typeof item[sortField] === 'string') {
// @ts-ignore Object is possibly null or undefined
return item[sortField].toLowerCase();
}
return item[sortField];
});
items = sortDirection === 'asc' ? items : items.reverse();

return {
Expand Down

0 comments on commit 4e9b521

Please sign in to comment.