Skip to content
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

Merged
merged 1 commit into from
Jan 31, 2025
Merged

SWC-7236 #1541

merged 1 commit into from
Jan 31, 2025

Conversation

nickgros
Copy link
Collaborator

  • Fix column resizing issue
  • SynapseTable: set initial column width to 200 (default is 150)

- 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,
Copy link
Collaborator Author

@nickgros nickgros Jan 31, 2025

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
Copy link
Collaborator Author

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',
Copy link
Collaborator Author

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

@nickgros nickgros merged commit eff9e9f into Sage-Bionetworks:main Jan 31, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants