Skip to content

Commit

Permalink
fix(admin-ui): Fix initial render of code editor input marking dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Oct 18, 2023
1 parent 4668391 commit 9dda349
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ export abstract class BaseCodeEditorFormInputComponent implements FormInputCompo
editor.innerHTML = this.highlight(code, this.getErrorPos(this.errorMessage));
};
this.jar = CodeJar(this.editorElementRef.nativeElement, highlight);
let isFirstUpdate = true;
this.jar.onUpdate(value => {
if (isFirstUpdate) {
isFirstUpdate = false;
return;
}
this.formControl.setValue(value);
this.formControl.markAsDirty();
this.isValid = this.formControl.valid;
Expand Down

0 comments on commit 9dda349

Please sign in to comment.