Просмотр исходного кода

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

Jason Grout 7 лет назад
Родитель
Сommit
639d949ccf
1 измененных файлов с 4 добавлено и 2 удалено
  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;