From 5bf5291bde6623322dd3a0747f40b73f8ce2ab14 Mon Sep 17 00:00:00 2001 From: Phil Starkey Date: Wed, 18 Sep 2024 12:07:26 +1000 Subject: [PATCH] DataTable: Allow drop below bottom row Fixes #6014 by removing the double counting of the page scroll position. The `getOffset()` utility function already includes the window's scroll position (see [here](https://github.com/primefaces/primeuix/blob/20388c576629d62cc9625ba87c1975aba78f85ef/packages/utils/src/dom/methods/getOffset.ts#L6-L7)). Double counting the scroll offset meant that the DataTable `onRowDragOver` event handler always through we were on the top-half of the row, preventing the indicator from being shown at the bottom of the row. --- packages/primevue/src/datatable/DataTable.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/primevue/src/datatable/DataTable.vue b/packages/primevue/src/datatable/DataTable.vue index 1a6b7e7e7..121411ba7 100755 --- a/packages/primevue/src/datatable/DataTable.vue +++ b/packages/primevue/src/datatable/DataTable.vue @@ -295,7 +295,6 @@ import { getOffset, getOuterHeight, getOuterWidth, - getWindowScrollTop, isClickable, removeClass, setAttribute @@ -1532,7 +1531,7 @@ export default { if (this.rowDragging && this.draggedRowIndex !== index) { let rowElement = event.currentTarget; - let rowY = getOffset(rowElement).top + getWindowScrollTop(); + let rowY = getOffset(rowElement).top; let pageY = event.pageY; let rowMidY = rowY + getOuterHeight(rowElement) / 2; let prevRowElement = rowElement.previousElementSibling;