Skip to content

Commit

Permalink
Inline
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 committed Oct 20, 2023
1 parent 6507666 commit cb21e5d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,6 @@ function DataGrid<R, SR, K extends Key>(
return idx >= minColIdx && idx <= maxColIdx;
}

function isColIdxWithinEditBounds(idx: number) {
return idx >= 0 && idx <= maxColIdx;
}

function isRowIdxWithinViewportBounds(rowIdx: number) {
return rowIdx >= 0 && rowIdx < rows.length;
}
Expand All @@ -688,7 +684,7 @@ function DataGrid<R, SR, K extends Key>(
}

function isCellWithinEditBounds({ idx, rowIdx }: Position): boolean {
return isRowIdxWithinViewportBounds(rowIdx) && isColIdxWithinEditBounds(idx);
return isRowIdxWithinViewportBounds(rowIdx) && idx >= 0 && idx <= maxColIdx;
}

function isCellWithinViewportBounds({ idx, rowIdx }: Position): boolean {
Expand Down

0 comments on commit cb21e5d

Please sign in to comment.