Skip to content

Commit

Permalink
thisPageX is not available for jquery event drag
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanceylan committed Jun 15, 2024
1 parent 420d9fb commit fc07531
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/grid/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,20 @@ export class Grid<TItem = any> 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();

Expand Down

0 comments on commit fc07531

Please sign in to comment.