Skip to content

Calling toggleHighlightOfEditableAreas immediately after initialization throws an exception. #77

@HardResetting

Description

@HardResetting

When I call toggleHighlightOfEditableAreas right after initializing the component, it throws an exception. However, if I wrap the call in a setTimeout, the exception does not occur.

this._editorInstance = monaco.editor.create(element, options);
this._constrainedInstance = constrainedEditor(monaco);
this._constrainedInstance.initializeIn(this._editorInstance);
this._editorInstance.getModel().toggleHighlightOfEditableAreas();

// this._editorInstance.getModel(...).toggleHighlightOfEditableAreas is not a function

Is there an asynchronous process during initialization that I should be awaiting before calling this method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions