diff --git a/apps/studio/state/table-editor-table.tsx b/apps/studio/state/table-editor-table.tsx index 63961d50c3f..bbd03577f7f 100644 --- a/apps/studio/state/table-editor-table.tsx +++ b/apps/studio/state/table-editor-table.tsx @@ -80,6 +80,11 @@ export const createTableEditorTableState = ({ { gridColumns: state.gridColumns } ) + // Clear undo history when switching to a different table to avoid cross-table undos + if (state.originalTable.id !== table.id) { + state.cellEditHistory = [] + } + state.table = supaTable state.gridColumns = gridColumns state.originalTable = table