Fixed TypeError when editor is focussed when not loaded
fix https://linear.app/tryghost/issue/SLO-162/typeerror-thiseditorapi-is-null - if the editor does not load for some reason (network issue), and the editor area is clicked, we throw an error because we don't protect against a null `editorAPI` - this adds that check
This commit is contained in:
parent
6099a14082
commit
6c07b1cff9
@ -236,7 +236,7 @@ export default class GhKoenigEditorLexical extends Component {
|
||||
// otherwise the browser will defocus the editor and the cursor will disappear
|
||||
@action
|
||||
focusEditor(event) {
|
||||
if (!this.skipFocusEditor && event.target.classList.contains('gh-koenig-editor-pane')) {
|
||||
if (!this.skipFocusEditor && event.target.classList.contains('gh-koenig-editor-pane') && this.editorAPI) {
|
||||
let editorCanvas = this.editorAPI.editorInstance.getRootElement();
|
||||
let {bottom} = editorCanvas.getBoundingClientRect();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user