Skip to content

Commit

Permalink
Merge pull request #1171 from securityscorecard/ajkl2533@UXD-1644
Browse files Browse the repository at this point in the history
fix(DatatableV2): fix missing sorting indicator
  • Loading branch information
ajkl2533 authored Oct 14, 2024
2 parents 1e5010d + b21a18d commit 5b59c44
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/DatatableV2/header/HeaderCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Inline } from '../../layout';
import { Tooltip } from '../../Tooltip';
import { displayColumnIds } from '../hooks/useDisplayColumns';
import { parseFromValuesOrFunc } from '../utils';
import { Icon } from '../../Icon';

const getTextHeaderStyle = (
labelLength: number | undefined,
Expand Down Expand Up @@ -43,6 +44,7 @@ const HeaderCell = <D,>({
headerComponent,
renderHeaderTooltip,
} = columnDef;
const direction = getIsSorted();

const showColumnActions =
(enableColumnActions || cdEnableColumnActions) &&
Expand Down Expand Up @@ -96,9 +98,17 @@ const HeaderCell = <D,>({
</button>
</Tooltip>
</Inline>
{showColumnActions && (
{showColumnActions ? (
<HeaderCellColumnActionsButton header={header} table={table} />
)}
) : direction !== false ? (
<div className="ds-table-header-cell-column-actions-button-wrapper">
<Icon
name={direction === 'asc' ? 'sort-up' : 'sort-down'}
size="sm"
hasFixedSize
/>
</div>
) : null}
{getCanResize() && (
<HeaderCellResizeHandler header={header} table={table} />
)}
Expand Down

0 comments on commit 5b59c44

Please sign in to comment.