Skip to content

Commit 2068d9a

Browse files
committed
fix(files): scroll preview tables from one container, not two nested ones
DataTable owned `overflow-x-auto` while its caller owns the vertical scroll, so now that preview tables are actually wider than the frame the horizontal scrollbar rendered at the foot of the table rather than at the bottom of the viewport — up to 1,000 rows below it for the two callers whose container is a plain block (xlsx-preview, preview-panel). csv-table-preview escaped it only because its flex column compressed the wrapper to the frame height. Drop the inner overflow so the caller's bounded container scrolls both axes. All three callers now place the scrollbar at the viewport bottom.
1 parent c9e8174 commit 2068d9a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/files/components/file-viewer

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/data-table.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ type EditingCell = { row: number; col: number } | null
2525
* Tabular renderer for CSV and XLSX previews. Chrome (borders, padding, typography, header fill)
2626
* comes entirely from `document-table.css`, the definition shared with markdown tables in the rich
2727
* markdown editor — the only classes here are the optional edit affordances.
28+
*
29+
* Scrolling belongs to the caller's bounded container, which already scrolls vertically. A preview
30+
* table is wider than its frame, so an `overflow-x` of its own would put the horizontal scrollbar
31+
* at the foot of all {@link CSV_PREVIEW_MAX_ROWS} rows instead of at the bottom of the viewport.
2832
*/
2933
const DataTableBase = forwardRef<DataTableHandle, DataTableProps>(function DataTable(
3034
{ headers, rows, editConfig },
@@ -100,7 +104,7 @@ const DataTableBase = forwardRef<DataTableHandle, DataTableProps>(function DataT
100104
editingCell?.row === row && editingCell?.col === col
101105

102106
return (
103-
<div className='document-table overflow-x-auto'>
107+
<div className='document-table'>
104108
<table>
105109
<thead>
106110
<tr>

0 commit comments

Comments
 (0)