提交 d9111772 编写于 作者: R rebornix

Focus editor when creating new cells

上级 214e4df1
......@@ -404,18 +404,10 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
}
};
if (this.list?.isRendering) {
// if (this.relayoutDisposable) {
// this.relayoutDisposable.dispose();
// this.relayoutDisposable = null;
// }
DOM.scheduleAtNextAnimationFrame(() => {
relayout(cell, height);
// this.relayoutDisposable = null;
});
} else {
DOM.scheduleAtNextAnimationFrame(() => {
relayout(cell, height);
}
// this.relayoutDisposable = null;
});
}
updateViewCells(splices: NotebookCellsSplice[]) {
......@@ -456,6 +448,7 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
this.viewCells!.splice(insertIndex, 0, newCell);
this.model!.insertCell(newCell.cell, insertIndex);
this.list?.splice(insertIndex, 0, [newCell]);
this.list?.setFocus([insertIndex]);
if (type === 'markdown') {
newCell.isEditing = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册