@linzjs/step-ag-grid 17.5.0 → 17.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2744,8 +2744,17 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
2744
2744
  clientSideRowModel.highlightRowAtPixel(null);
2745
2745
  }, []);
2746
2746
  const onRowDragMove = useCallback((event) => {
2747
- const clientSideRowModel = event.api.getModel();
2748
- clientSideRowModel.highlightRowAtPixel(event.node, event.y);
2747
+ if (event.overNode && event.node.rowIndex != null) {
2748
+ const clientSideRowModel = event.api.getModel();
2749
+ //position 0 means highlight above, 1 means below
2750
+ const position = clientSideRowModel.getHighlightPosition(event.y, event.overNode);
2751
+ //we don't want to show the row highlight if it wouldn't result in the row moving
2752
+ const targetIndex = event.overIndex + position - (event.node.rowIndex < event.overIndex ? 1 : 0);
2753
+ //console.log(targetIndex)
2754
+ if (event.node.rowIndex != targetIndex) {
2755
+ clientSideRowModel.highlightRowAtPixel(event.node, event.y);
2756
+ }
2757
+ }
2749
2758
  }, []);
2750
2759
  const onRowDragEnd = useCallback(async (event) => {
2751
2760
  const clientSideRowModel = event.api.getModel();