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) {
153
153
id : selectColumn . name ,
154
154
enableSorting : isSortableColumn ( selectColumn . columnType ) ,
155
155
enableResizing : true ,
156
+ size : 200 ,
156
157
header : TableDataColumnHeader ,
157
158
cell : TableDataCell ,
158
159
} )
Original file line number Diff line number Diff line change @@ -73,10 +73,15 @@ export default function StyledTanStackTable<
73
73
header . column . getSize ( )
74
74
}
75
75
return colSizes
76
+ // Intentionally limit the dependencies to only recompute when the column sizes change
76
77
// 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
+ ] )
78
83
79
- const tableWidth = fullWidth ? '100%' : table . getTotalSize ( )
84
+ const tableWidth = fullWidth ? '100%' : ` ${ table . getTotalSize ( ) } px`
80
85
81
86
/* When resizing any column we will render this special memoized version of our table body */
82
87
const TableBodyElement = table . getState ( ) . columnSizingInfo . isResizingColumn
@@ -89,6 +94,7 @@ export default function StyledTanStackTable<
89
94
{ ...tableSlotProps }
90
95
style = { {
91
96
...columnSizeVars ,
97
+ tableLayout : 'fixed' ,
92
98
width : tableWidth ,
93
99
...tableSlotProps [ 'style' ] ,
94
100
} }
You can’t perform that action at this time.
0 commit comments