Skip to content

Commit

Permalink
fix: keep the selected row in its position when it gets focused below…
Browse files Browse the repository at this point in the history
… the previous row (#7022)
  • Loading branch information
KumJungMin authored Aug 11, 2024
1 parent ca5b5e7 commit 9bc0a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/datatable/TableBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ export const TableBody = React.memo(
!isUnstyled() && DomHandler.addClass(rowElement, 'p-datatable-dragpoint-top');
}

droppedRowIndex.current = index + 1;
if (index + 1 !== draggedRowIndex.current) droppedRowIndex.current = index + 1;
rowElement.setAttribute('data-p-datatable-dragpoint-bottom', 'true');
!isUnstyled() && DomHandler.addClass(rowElement, 'p-datatable-dragpoint-bottom');
}
Expand Down

0 comments on commit 9bc0a62

Please sign in to comment.