Skip to content

Commit

Permalink
Fix: empty table when there is only 1 cell.
Browse files Browse the repository at this point in the history
  • Loading branch information
csansoon committed Jun 20, 2024
1 parent 2041b23 commit c8abd28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/display_table/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ export default function Table({ data }: { data: QueryResult }) {
if (selectedCell.col < colsOffset) {
setColsOffset(selectedCell.col)
} else if (selectedCell.col >= colsOffset + visibleCols.length) {
setColsOffset(selectedCell.col - visibleCols.length + 1)
setColsOffset(Math.min(columns.length - 1, selectedCell.col - visibleCols.length + 1))
}
}, [selectedCell, visibleRows.length, visibleCols.length])
}, [selectedCell, visibleRows.length, visibleCols.length, columns.length])

return (
<Box
Expand Down

0 comments on commit c8abd28

Please sign in to comment.