Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't restructure `originalEvent` in `allowRowDrag`, just pass the full event through from `onRowDragStart`
  • Loading branch information
gcko committed Sep 19, 2024
1 parent 7df02d0 commit f17a5c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/datatable/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const TableBody = React.memo(
};

const allowRowDrag = (event) => {
return (!allowCellSelection() && allowDrag({ originalEvent: event })) || props.reorderableRows;
return (!allowCellSelection() && allowDrag(event)) || props.reorderableRows;
};

const allowCellDrag = (event) => {
Expand Down Expand Up @@ -668,7 +668,7 @@ export const TableBody = React.memo(
const onRowDragStart = (e) => {
const { originalEvent: event, index } = e;

if (allowRowDrag(event)) {
if (allowRowDrag(e)) {
rowDragging.current = true;
draggedRowIndex.current = index;
event.dataTransfer.setData('text', 'b'); // For firefox
Expand Down

0 comments on commit f17a5c1

Please sign in to comment.