Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(sql-editor): auto-adjusting width doesn't work sometimes (#4698)

Liu Ji10ddec7defe7
diff --git a/frontend/src/views/sql-editor/EditorCommon/useTableResize.ts b/frontend/src/views/sql-editor/EditorCommon/useTableResize.ts
index 0c07cea034..87b3913bfc 100644
--- a/frontend/src/views/sql-editor/EditorCommon/useTableResize.ts
+++ b/frontend/src/views/sql-editor/EditorCommon/useTableResize.ts
@@ -173,21 +173,18 @@ const useTableResize = (options: TableResizeOptions) => {
if (!column) return {};
return {
style: {
- width: `${column.width}px`,
+ width: state.isAutoAdjusting ? "auto" : `${column.width}px`,
},
- class: "truncate",
+ class: state.isAutoAdjusting ? "" : "truncate",
"data-index": index,
};
};
const getTableProps = () => {
- if (state.isAutoAdjusting) {
- return {};
- }
const totalWidth = sumBy(state.columns, (col) => col.width);
return {
style: {
- width: `${totalWidth}px`,
+ width: state.isAutoAdjusting ? "auto" : `${totalWidth}px`,
},
};
};