mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 23:07:02 +08:00
fix(editor): insertion position of new rows and columns is incorrect in table block (#10516)
fix: BS-2714
This commit is contained in:
@@ -180,14 +180,16 @@ export class TableCell extends SignalWatcher(
|
||||
name: 'Insert Left',
|
||||
prefix: InsertLeftIcon(),
|
||||
select: () => {
|
||||
this.dataManager.insertColumn(columnIndex - 1);
|
||||
this.dataManager.insertColumn(
|
||||
columnIndex > 0 ? columnIndex - 1 : undefined
|
||||
);
|
||||
},
|
||||
}),
|
||||
menu.action({
|
||||
name: 'Insert Right',
|
||||
prefix: InsertRightIcon(),
|
||||
select: () => {
|
||||
this.dataManager.insertColumn(columnIndex + 1);
|
||||
this.dataManager.insertColumn(columnIndex);
|
||||
},
|
||||
}),
|
||||
menu.action({
|
||||
@@ -304,14 +306,16 @@ export class TableCell extends SignalWatcher(
|
||||
name: 'Insert Above',
|
||||
prefix: InsertAboveIcon(),
|
||||
select: () => {
|
||||
this.dataManager.insertRow(rowIndex - 1);
|
||||
this.dataManager.insertRow(
|
||||
rowIndex > 0 ? rowIndex - 1 : undefined
|
||||
);
|
||||
},
|
||||
}),
|
||||
menu.action({
|
||||
name: 'Insert Below',
|
||||
prefix: InsertBelowIcon(),
|
||||
select: () => {
|
||||
this.dataManager.insertRow(rowIndex + 1);
|
||||
this.dataManager.insertRow(rowIndex);
|
||||
},
|
||||
}),
|
||||
menu.action({
|
||||
|
||||
Reference in New Issue
Block a user