Browse Source

fix "maximum call stack size exceeded" error with rich text editor

pull/357/head
alwinnen@gmail.com 7 years ago
parent
commit
49dbd6f7af
  1. 12
      src/Squidex/app/framework/angular/forms/control-errors.component.ts

12
src/Squidex/app/framework/angular/forms/control-errors.component.ts

@ -60,10 +60,7 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements
public ngOnDestroy() { public ngOnDestroy() {
super.ngOnDestroy(); super.ngOnDestroy();
this.restoreOriginalMarkAsTouchedFunction();
if (this.control && this.originalMarkAsTouched) {
this.control['markAsTouched'] = this.originalMarkAsTouched;
}
} }
public ngOnChanges() { public ngOnChanges() {
@ -87,6 +84,7 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements
if (this.control !== control) { if (this.control !== control) {
this.unsubscribeAll(); this.unsubscribeAll();
this.restoreOriginalMarkAsTouchedFunction();
this.control = control; this.control = control;
@ -112,6 +110,12 @@ export class ControlErrorsComponent extends StatefulComponent<State> implements
this.createMessages(); this.createMessages();
} }
private restoreOriginalMarkAsTouchedFunction() {
if (this.control && this.originalMarkAsTouched) {
this.control['markAsTouched'] = this.originalMarkAsTouched;
}
}
private createMessages() { private createMessages() {
const errors: string[] = []; const errors: string[] = [];

Loading…
Cancel
Save