Skip to content

Commit

Permalink
work for #6205 fix RangeError: Maximum call stack size exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Jul 20, 2023
1 parent a82d92d commit b12ffff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/survey-angular-ui/src/base-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ export abstract class BaseAngular<T extends Base = Base> extends EmbeddedViewCon
this.beforeUpdate();
if(this.getPropertiesToUpdateSync().indexOf(key) > -1) {
this.detectChanges();
this.afterUpdate();
this.afterUpdate(key);
} else {
((<any>window)["__zone_symbol__queueMicrotask"]
? (<any>window)["__zone_symbol__queueMicrotask"] : queueMicrotask)(() => {
if(!this.isDestroyed) {
this.setIsRendering(true);
this.detectChanges();
}
this.afterUpdate();
this.afterUpdate(key);
});
}
}
Expand All @@ -121,7 +121,7 @@ export abstract class BaseAngular<T extends Base = Base> extends EmbeddedViewCon
}
this.setIsRendering(true);
}
protected afterUpdate(): void {
protected afterUpdate(key: string): void {
if(this.getShouldReattachChangeDetector()) {
this.getChangeDetectorRef().reattach();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ export class PopupBaseContainerComponent<T extends PopupBaseViewModel = PopupBas
this.changeDetectorRef.detectChanges();
}

protected override afterUpdate(): void {
super.afterUpdate();
if (!this.prevIsVisible && this.model.isVisible) {
this.model.updateOnShowing();
}
if (this.prevIsVisible !== this.model.isVisible) {
this.prevIsVisible = this.model.isVisible;
protected override afterUpdate(key: string): void {
super.afterUpdate(key);

if(key === "isVisible") {
if (!this.prevIsVisible && this.model.isVisible) {
this.model.updateOnShowing();
}
if (this.prevIsVisible !== this.model.isVisible) {
this.prevIsVisible = this.model.isVisible;
}
}
}
public clickInside(event: any) {
Expand Down

0 comments on commit b12ffff

Please sign in to comment.