fix: fix isEditable check on initialization

This commit is contained in:
Philipp Kühn
2021-08-09 17:40:45 +02:00
parent 80296aa8d0
commit f6f8cf9f93

View File

@@ -159,7 +159,12 @@ export class Editor extends EventEmitter {
* Returns whether the editor is editable.
*/
public get isEditable(): boolean {
return this.view && this.view.editable
// since plugins are applied after creating the view
// `editable` is always `true` for one tick.
// thats why we also have to check for `options.editable`
return this.options.editable
&& this.view
&& this.view.editable
}
/**