Skip to content

Commit

Permalink
fix onColumnProposeMove rowMarkerOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHung authored Jun 11, 2024
1 parent 5983dca commit cfc6841
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/core/src/data-editor/data-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2528,6 +2528,17 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
]
);

const onColumnProposeMoveImpl = whenDefined(
onColumnProposeMove,
React.useCallback(
(startIndex: number, endIndex: number) => {
return onColumnProposeMove?.(startIndex - rowMarkerOffset, endIndex - rowMarkerOffset);
},
[onColumnProposeMove, rowMarkerOffset]
)
)


const onColumnMovedImpl = whenDefined(
onColumnMoved,
React.useCallback(
Expand Down Expand Up @@ -4052,7 +4063,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
columns={mangledCols}
nonGrowWidth={nonGrowWidth}
drawHeader={drawHeader}
onColumnProposeMove={onColumnProposeMove}
onColumnProposeMove={onColumnProposeMoveImpl}
drawCell={drawCell}
disabledRows={disabledRows}
freezeColumns={mangledFreezeColumns}
Expand Down

0 comments on commit cfc6841

Please sign in to comment.