When using the tab key on a readOnly editor, this error occurs:
Uncaught TypeError: this.content is undefined
tab CodeEditor.vue:283
To solve it, we need to change these lines:
https://github.com/justcaliturner/simple-code-editor/blob/master/npm-package/CodeEditor.vue#L282-L283
+ if (this.content) {
this.content =
this.content.substring(0, cursorPosition) + this.tabWidth + this.content.substring(cursorPosition);
+ }
or another option, do a:
if (this.readOnly) return
as the first line of the tab method.