Skip to content

Commit

Permalink
Fix getting value in default sort func
Browse files Browse the repository at this point in the history
  • Loading branch information
chervyakovru committed Jan 20, 2024
1 parent a447acc commit e9d62fc
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import _get from 'lodash/get';
import _memoize from 'lodash/memoize';

import {block} from '../../../utils/cn';
Expand Down Expand Up @@ -44,7 +45,7 @@ export function withTableSorting<I extends TableDataItem, E extends {} = {}>(
const displayName = `withTableSorting(${componentName})`;

function defaultCompareFunction(itemA: I, itemB: I, columnId: string) {
if (itemA[columnId] === itemB[columnId]) {
if (_get(itemA, columnId) === _get(itemB, columnId)) {
return 0;
} else {
return itemA[columnId] > itemB[columnId] ? 1 : -1;
Expand Down

0 comments on commit e9d62fc

Please sign in to comment.