Skip to content

Commit

Permalink
Be a little permissive with going outside the grid
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Jul 31, 2022
1 parent aa57ee5 commit 3ad9e27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/data-grid/data-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ const DataGrid: React.ForwardRefRenderFunction<DataGridRef, DataGridProps> = (p,
const metaKey = ev?.metaKey === true;
const isTouch = ev !== undefined && !(ev instanceof MouseEvent);

const edgeSize = 25;
const edgeSize = 20;
const scrollEdge: GridMouseEventArgs["scrollEdge"] = [
x < edgeSize ? -1 : x > rect.width - edgeSize ? 1 : 0,
y < edgeSize ? -1 : y > rect.height - edgeSize ? 1 : 0,
Math.abs(x) < edgeSize ? -1 : Math.abs(rect.width - x) < edgeSize ? 1 : 0,
Math.abs(y) < edgeSize ? -1 : Math.abs(rect.height - y) < edgeSize ? 1 : 0,
];

let result: GridMouseEventArgs;
Expand All @@ -394,7 +394,7 @@ const DataGrid: React.ForwardRefRenderFunction<DataGridRef, DataGridProps> = (p,
isEdge,
isTouch,
button,
scrollEdge: [0, 0],
scrollEdge,
};
} else if (row <= -1) {
let bounds = getBoundsForItem(canvas, col, row);
Expand Down

0 comments on commit 3ad9e27

Please sign in to comment.