提交 1ccad27e 编写于 作者: R rebornix

push diff editor relayout to next tick, to avoid height change side effects...

push diff editor relayout to next tick, to avoid height change side effects when updating original editor first.
上级 b3a5f15b
......@@ -769,6 +769,7 @@ export class DeletedCell extends AbstractCellRenderer {
}
}
layout(state: { outerWidth?: boolean, editorHeight?: boolean, metadataEditor?: boolean, outputEditor?: boolean }) {
DOM.scheduleAtNextAnimationFrame(() => {
if (state.editorHeight || state.outerWidth) {
this._editor.layout({
width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
......@@ -791,6 +792,7 @@ export class DeletedCell extends AbstractCellRenderer {
}
this.layoutNotebookCell();
});
}
}
......@@ -857,6 +859,7 @@ export class InsertCell extends AbstractCellRenderer {
}
layout(state: { outerWidth?: boolean, editorHeight?: boolean, metadataEditor?: boolean, outputEditor?: boolean }) {
DOM.scheduleAtNextAnimationFrame(() => {
if (state.editorHeight || state.outerWidth) {
this._editor.layout({
width: this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, false),
......@@ -879,6 +882,7 @@ export class InsertCell extends AbstractCellRenderer {
}
this.layoutNotebookCell();
});
}
}
......@@ -963,6 +967,7 @@ export class ModifiedCell extends AbstractCellRenderer {
}
layout(state: { outerWidth?: boolean, editorHeight?: boolean, metadataEditor?: boolean, outputEditor?: boolean }) {
DOM.scheduleAtNextAnimationFrame(() => {
if (state.editorHeight || state.outerWidth) {
this._editorContainer.style.height = `${this._layoutInfo.editorHeight}px`;
this._editor!.layout();
......@@ -983,5 +988,6 @@ export class ModifiedCell extends AbstractCellRenderer {
}
this.layoutNotebookCell();
});
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册