diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx index b9af5aaaf6f..e6402151df7 100644 --- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx +++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/TableEditor.tsx @@ -286,9 +286,12 @@ export const TableEditor = ({ { - if (template.name) onUpdateField({ name: template.name }) - if (template.comment) onUpdateField({ comment: template.comment }) - if (template.columns) onUpdateField({ columns: template.columns }) + // Update all fields at once to avoid closure issues + const updates: Partial = {} + if (template.name) updates.name = template.name + if (template.comment) updates.comment = template.comment + if (template.columns) updates.columns = template.columns + onUpdateField(updates) }} disabled={false} />