-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWC-7236 #1541
SWC-7236 #1541
Conversation
nickgros
commented
Jan 31, 2025
- Fix column resizing issue
- SynapseTable: set initial column width to 200 (default is 150)
@@ -153,6 +153,7 @@ export function SynapseTable(props: SynapseTableProps) { | |||
id: selectColumn.name, | |||
enableSorting: isSortableColumn(selectColumn.columnType), | |||
enableResizing: true, | |||
size: 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Synapse Tables, make the initial width of each column slightly wider
}, [ | ||
table.getState().columnSizingInfo, | ||
table.getState().columnSizing, | ||
table.getState().columnVisibility, // If a column is added, its width should be recalculated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes an occasional bug where these CSS variables would be initialized before SynapseTable had configured its visible columns.
@@ -89,6 +94,7 @@ export default function StyledTanStackTable< | |||
{...tableSlotProps} | |||
style={{ | |||
...columnSizeVars, | |||
tableLayout: 'fixed', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the re-sizing issue. This seems to work well for both dynamic-width tables and fullWidth (100%) tables