Skip to content

Commit

Permalink
onColumnProposeMove should prevent drag
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHung authored Jun 11, 2024
1 parent 5983dca commit 58a8357
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/internal/data-grid-dnd/data-grid-dnd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const DataGridDnd: React.FunctionComponent<DataGridDndProps> = p => {
}

clearAll();
if (dragCol !== undefined && dropCol !== undefined) {
if (dragCol !== undefined && dropCol !== undefined && !(onColumnProposeMove?.(dragCol, dropCol) === false)) {
onColumnMoved?.(dragCol, dropCol);
}
if (dragRow !== undefined && dropRow !== undefined) {
Expand All @@ -277,6 +277,7 @@ const DataGridDnd: React.FunctionComponent<DataGridDndProps> = p => {
onColumnMoved,
onRowMoved,
clearAll,
onColumnProposeMove,
]
);

Expand Down

0 comments on commit 58a8357

Please sign in to comment.