I'm facing a challenge with my HTML file that includes the integration of a Monaco editor. Upon initially loading the page, the editor appears to be stuck. Strangely, it only starts working when I open my developer tools; if I don't do this, it remains unresponsive. Below is the snippet of HTML code in question:
<div class="condition-label">Condition</div>
<ngx-monaco-editor
[ngClass]="{'error-border' : errorMessage.emptyExpression}"
[value]="userInput.textChange"
[options]="options"
[(ngModel)]="userInput.textChange"
(onInit)="onInit()"
></ngx-monaco-editor>
<ngx-loading [show]="monacoLoader"></ngx-loading>
<div *ngIf="errorMessage?.emptyExpression" class="error-on-empty-condition"><nile-icon name="info" size="14px" color="var(--nile-colors-red-700)"></nile-icon>This field cannot be left blank</div>
</div>
Here are the TypeScript options related to this issue:
public options = {
theme : 'vs',
language : 'javascript',
fontSize: "14px",
wordWrap: 'on',
lineNumbers: "on",
minimap: {
enabled: false
}
}
monacoLoader = false;
onInit(){
this.monacoLoader = false;
}
logger(){
this.monacoLoader = false;
this.cdr.detectChanges();
}
I'm puzzled by this behavior and unsure of how to resolve it. Any suggestions or solutions would be appreciated!