File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/synapse-react-client/src/components Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,7 @@ export function SynapseTable(props: SynapseTableProps) {
153153 id : selectColumn . name ,
154154 enableSorting : isSortableColumn ( selectColumn . columnType ) ,
155155 enableResizing : true ,
156+ size : 200 ,
156157 header : TableDataColumnHeader ,
157158 cell : TableDataCell ,
158159 } )
Original file line number Diff line number Diff line change @@ -73,10 +73,15 @@ export default function StyledTanStackTable<
7373 header . column . getSize ( )
7474 }
7575 return colSizes
76+ // Intentionally limit the dependencies to only recompute when the column sizes change
7677 // eslint-disable-next-line react-hooks/exhaustive-deps
77- } , [ table . getState ( ) . columnSizingInfo , table . getState ( ) . columnSizing ] )
78+ } , [
79+ table . getState ( ) . columnSizingInfo ,
80+ table . getState ( ) . columnSizing ,
81+ table . getState ( ) . columnVisibility , // If a column is added, its width should be recalculated
82+ ] )
7883
79- const tableWidth = fullWidth ? '100%' : table . getTotalSize ( )
84+ const tableWidth = fullWidth ? '100%' : ` ${ table . getTotalSize ( ) } px`
8085
8186 /* When resizing any column we will render this special memoized version of our table body */
8287 const TableBodyElement = table . getState ( ) . columnSizingInfo . isResizingColumn
@@ -89,6 +94,7 @@ export default function StyledTanStackTable<
8994 { ...tableSlotProps }
9095 style = { {
9196 ...columnSizeVars ,
97+ tableLayout : 'fixed' ,
9298 width : tableWidth ,
9399 ...tableSlotProps [ 'style' ] ,
94100 } }
You can’t perform that action at this time.
0 commit comments