From 49dbd6f7af109e55bcc9af6809209c9681d59062 Mon Sep 17 00:00:00 2001 From: "alwinnen@gmail.com" Date: Sat, 4 May 2019 12:45:59 +0200 Subject: [PATCH] fix "maximum call stack size exceeded" error with rich text editor --- .../angular/forms/control-errors.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Squidex/app/framework/angular/forms/control-errors.component.ts b/src/Squidex/app/framework/angular/forms/control-errors.component.ts index 010e2777e..22bd8af72 100644 --- a/src/Squidex/app/framework/angular/forms/control-errors.component.ts +++ b/src/Squidex/app/framework/angular/forms/control-errors.component.ts @@ -60,10 +60,7 @@ export class ControlErrorsComponent extends StatefulComponent implements public ngOnDestroy() { super.ngOnDestroy(); - - if (this.control && this.originalMarkAsTouched) { - this.control['markAsTouched'] = this.originalMarkAsTouched; - } + this.restoreOriginalMarkAsTouchedFunction(); } public ngOnChanges() { @@ -87,6 +84,7 @@ export class ControlErrorsComponent extends StatefulComponent implements if (this.control !== control) { this.unsubscribeAll(); + this.restoreOriginalMarkAsTouchedFunction(); this.control = control; @@ -112,6 +110,12 @@ export class ControlErrorsComponent extends StatefulComponent implements this.createMessages(); } + private restoreOriginalMarkAsTouchedFunction() { + if (this.control && this.originalMarkAsTouched) { + this.control['markAsTouched'] = this.originalMarkAsTouched; + } + } + private createMessages() { const errors: string[] = [];