Browse Source

Backport PR #11346: Only trigger dirty status update on value changes (#11351)

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
MeeseeksMachine 3 years ago
parent
commit
3a2520dd9e
1 changed files with 4 additions and 3 deletions
  1. 4 3
      packages/cells/src/model.ts

+ 4 - 3
packages/cells/src/model.ts

@@ -625,6 +625,8 @@ export class CodeCellModel extends CellModel implements ICodeCellModel {
         executionCount.set(null);
       }
     }
+    this.value.changed.connect(this._onValueChanged, this);
+
     executionCount.changed.connect(this._onExecutionCountChanged, this);
 
     this._modelDBMutex(() => {
@@ -818,13 +820,12 @@ export class CodeCellModel extends CellModel implements ICodeCellModel {
   }
 
   /**
-   * Handle a change to the observable value.
+   * Handle a change to the code cell value.
    */
-  protected onGenericChange(): void {
+  private _onValueChanged(): void {
     if (this.executionCount !== null) {
       this._setDirty(this._executedCode !== this.value.text.trim());
     }
-    this.contentChanged.emit(void 0);
   }
 
   /**