fix(views/table): wrong position when renaming column

This commit is contained in:
Elian Doran 2025-07-16 09:23:06 +03:00
parent 2244f0368f
commit 34f1a84769
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View File

@ -81,14 +81,15 @@ export default class TableColumnEditing extends Component {
this.api.blockRedraw();
if (this.existingAttributeToEdit && this.existingAttributeToEdit.name !== name) {
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
const oldName = this.existingAttributeToEdit.name.split(":")[1];
const newName = name.split(":")[1];
await renameColumn(this.parentNote.noteId, type, oldName, newName);
}
attributes.setLabel(this.parentNote.noteId, name, value);
if (this.existingAttributeToEdit) {
attributes.removeOwnedLabelByName(this.parentNote, this.existingAttributeToEdit.name);
}
this.api.restoreRedraw();
}

View File

@ -92,6 +92,7 @@ function showColumnContextMenu(_e: UIEvent, column: ColumnComponent, tabulator:
uiIcon: "bx bx-edit",
enabled: !!column.getField() && column.getField() !== "title",
handler: () => getParentComponent(e)?.triggerCommand("addNewTableColumn", {
referenceColumn: column,
columnToEdit: column
})
},