Skip to content

Commit

Permalink
[DataGridPro] Fix dragging styles removal in column reorder (#14680)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 authored Sep 28, 2024
1 parent 110b83e commit 1cfe453
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ export const useGridColumnReorder = (
event.stopPropagation();

clearTimeout(removeDnDStylesTimeout.current);

// For more information check here https://github.com/mui/mui-x/issues/14678
if (dragColNode.current!.classList.contains(classes.columnHeaderDragging)) {
dragColNode.current!.classList.remove(classes.columnHeaderDragging);
}

dragColNode.current = null;

// Check if the column was dropped outside the grid.
Expand All @@ -335,7 +341,13 @@ export const useGridColumnReorder = (
}));
apiRef.current.forceUpdate();
},
[props.disableColumnReorder, props.keepColumnPositionIfDraggedOutside, logger, apiRef],
[
apiRef,
props.disableColumnReorder,
props.keepColumnPositionIfDraggedOutside,
logger,
classes.columnHeaderDragging,
],
);

useGridApiEventHandler(apiRef, 'columnHeaderDragStart', handleDragStart);
Expand Down

0 comments on commit 1cfe453

Please sign in to comment.