Skip to content

Commit 3a2520d

Browse files
Backport PR jupyterlab#11346: Only trigger dirty status update on value changes (jupyterlab#11351)
Co-authored-by: Michał Krassowski <[email protected]>
1 parent 3e0467c commit 3a2520d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/cells/src/model.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,8 @@ export class CodeCellModel extends CellModel implements ICodeCellModel {
625625
executionCount.set(null);
626626
}
627627
}
628+
this.value.changed.connect(this._onValueChanged, this);
629+
628630
executionCount.changed.connect(this._onExecutionCountChanged, this);
629631

630632
this._modelDBMutex(() => {
@@ -818,13 +820,12 @@ export class CodeCellModel extends CellModel implements ICodeCellModel {
818820
}
819821

820822
/**
821-
* Handle a change to the observable value.
823+
* Handle a change to the code cell value.
822824
*/
823-
protected onGenericChange(): void {
825+
private _onValueChanged(): void {
824826
if (this.executionCount !== null) {
825827
this._setDirty(this._executedCode !== this.value.text.trim());
826828
}
827-
this.contentChanged.emit(void 0);
828829
}
829830

830831
/**

0 commit comments

Comments
 (0)