Skip to content

Commit

Permalink
feat(database): focus to title column when click New Record button (#…
Browse files Browse the repository at this point in the history
…6561)

close: #6559
  • Loading branch information
zzj3720 committed Mar 25, 2024
1 parent f52501f commit 8607e5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/blocks/src/database-block/table/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ export class TableGroup extends WithDisposable(ShadowlessElement) {
this.view.rowAdd('end', this.group?.key);
requestAnimationFrame(() => {
const selectionController = this.viewEle.selectionController;
const index = this.view.columnManagerList.findIndex(
v => v.type === 'title'
);
selectionController.selection = {
groupKey: this.group?.key,
focus: {
rowIndex: this.rows.length - 1,
columnIndex: 0,
columnIndex: index,
},
isEditing: true,
};
Expand Down

0 comments on commit 8607e5d

Please sign in to comment.