Skip to content

Commit

Permalink
Prevent fetching out of bounds data when sizing a column
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Aug 1, 2022
1 parent c3d2bc1 commit c999082
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/core/src/data-editor/data-editor.tsx
Expand Up @@ -1387,7 +1387,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
x: col,
y: start,
width: 1,
height: end,
height: Math.min(end, rows - start),
},
abortControllerRef.current.signal
);
Expand All @@ -1413,7 +1413,16 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
}
}
},
[columns, getCellsForSelection, maxColumnWidth, mergedTheme, minColumnWidth, onColumnResize, rowMarkerOffset]
[
columns,
getCellsForSelection,
maxColumnWidth,
mergedTheme,
minColumnWidth,
onColumnResize,
rowMarkerOffset,
rows,
]
);

const [scrollDir, setScrollDir] = React.useState<GridMouseEventArgs["scrollEdge"]>();
Expand Down

0 comments on commit c999082

Please sign in to comment.