Selaa lähdekoodia

Only change editor readonly status if needed in a cell update. (#3617)

Jason Grout 7 vuotta sitten
vanhempi
commit
639d949ccf
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      packages/cells/src/widget.ts

+ 4 - 2
packages/cells/src/widget.ts

@@ -370,8 +370,10 @@ class Cell extends Widget {
       return;
     }
     // Handle read only state.
-    this.editor.setOption('readOnly', this._readOnly);
-    this.toggleClass(READONLY_CLASS, this._readOnly);
+    if (this.editor.getOption('readOnly') !== this._readOnly) {
+      this.editor.setOption('readOnly', this._readOnly);
+      this.toggleClass(READONLY_CLASS, this._readOnly);
+    }
   }
 
   private _readOnly = false;