You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When form with editor is loaded form is marked as dirty.
I did some research and found that in registerEditorListeners method variable hasValidationStatusChanged will resolve to true when control initialized and no changes were made.
This is due to the fact that this.parsedError resolves to undefined and currentParsedError is '' so following line will resolve to true: const hasValidationStatusChanged = this.parsedError !== currentParsedError;
This causing control to be flagged as modified and when its part of FormGroup it marks the whole form as dirty.
I am using ngx-monaco-editor as follow: <ngx-monaco-editor [options]="editorOptions" formControlName="queryText" (init)="editorInit($event)"></ngx-monaco-editor>
Is there work around or its by design?
Thanks,
Oleg
The text was updated successfully, but these errors were encountered:
Sorry for the late reply. I don't face this issue, when trying to reproduce with angular v12 and latest library version v5.1.0.
Here is a stackblitz link showing the actual behavior: https://stackblitz.com/edit/angular-ogp6rc.
If you still face this issue, please kindly share a reproduction of the bug.
I just upgraded to Angular 12 and still facing the issue. (Will try to create reproduceable example later)
I did noticed interesting behavior that occasionally this error doesn't occur in some cases, I think it has to do with text size or some other factor, still trying to figure it out.
Maybe if parsedError would be initialized to '' then error would go away, since eventually it set to '' anyway as initial state?
Hi,
When form with editor is loaded form is marked as dirty.
I did some research and found that in
registerEditorListeners
method variablehasValidationStatusChanged
will resolve to true when control initialized and no changes were made.This is due to the fact that
this.parsedError
resolves to undefined andcurrentParsedError
is '' so following line will resolve to true:const hasValidationStatusChanged = this.parsedError !== currentParsedError;
This causing control to be flagged as modified and when its part of FormGroup it marks the whole form as dirty.
I am using ngx-monaco-editor as follow:
<ngx-monaco-editor [options]="editorOptions" formControlName="queryText" (init)="editorInit($event)"></ngx-monaco-editor>
Is there work around or its by design?
Thanks,
Oleg
The text was updated successfully, but these errors were encountered: