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](20388c5766/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.
pull/6424/head
Phil Starkey 2024-09-18 12:07:26 +10:00
parent 02094f31ae
commit 5bf5291bde
1 changed files with 1 additions and 2 deletions

View File

@ -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;