From fc07531d91e7c0be8b61870a45c80e02fea1d5b8 Mon Sep 17 00:00:00 2001 From: volkanceylan Date: Sat, 15 Jun 2024 15:45:01 +0300 Subject: [PATCH] thisPageX is not available for jquery event drag --- src/grid/grid.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/grid/grid.ts b/src/grid/grid.ts index 048706a..6eb9a65 100644 --- a/src/grid/grid.ts +++ b/src/grid/grid.ts @@ -987,15 +987,20 @@ export class Grid implements EditorHost { }; const drag = (e: DragEvent) => { + var dist; if (noJQueryDrag) { var thisPageX = (!e.pageX && !e.pageY) ? lastDragOverPos?.pageX : e.pageX; var thisPageY = (!e.pageX && !e.pageY) ? lastDragOverPos?.pageY : e.pageY; if (!thisPageX && !e.clientX && !thisPageY && !e.clientY) return; + dist = Math.min(maxPageX, Math.max(minPageX, thisPageX)) - pageX; e.dataTransfer.effectAllowed = 'none'; e.preventDefault(); } - shrinkOrStretchColumn(cols, colIdx, Math.min(maxPageX, Math.max(minPageX, thisPageX)) - pageX, this._options.forceFitColumns, this._absoluteColMinWidth); + else { + dist = Math.min(maxPageX, Math.max(minPageX, e.pageX)) - pageX; + } + shrinkOrStretchColumn(cols, colIdx, dist, this._options.forceFitColumns, this._absoluteColMinWidth); this._layout.afterHeaderColumnDrag();