Skip to content

Commit

Permalink
1544: dont add draghandler at last column
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben van Leeuwen committed Dec 2, 2024
1 parent 8895dbf commit 833f0d8
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const WfoTableHeaderRow = <T extends object>({
const headerRowRef = useRef<HTMLTableRowElement>(null);
return (
<tr className={className} css={rowStyle} ref={headerRowRef}>
{sortedVisibleColumns.map(([fieldName, columnConfig]) => {
{sortedVisibleColumns.map(([fieldName, columnConfig], index) => {
const dataSortingConfiguration = dataSorting.find(
(dataSorting) => dataSorting.field === fieldName,
);
Expand Down Expand Up @@ -103,13 +103,17 @@ export const WfoTableHeaderRow = <T extends object>({
>
{columnConfig.label?.toString()}
</WfoTableHeaderCell>
{onUpdateColumWidth && (
<WfoDragHandler
headerRowRef={headerRowRef}
fieldName={fieldName}
onUpdateColumWidth={onUpdateColumWidth}
/>
)}
{onUpdateColumWidth &&
index !==
sortedVisibleColumns.length - 1 && (
<WfoDragHandler
headerRowRef={headerRowRef}
fieldName={fieldName}
onUpdateColumWidth={
onUpdateColumWidth
}
/>
)}
</div>
</th>
);
Expand Down

0 comments on commit 833f0d8

Please sign in to comment.