Skip to content

Commit

Permalink
Fix for creator
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Jan 14, 2025
1 parent 1bb6d46 commit fc3e8a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export class ActionComponent extends BaseAngular implements AfterViewInit {
getModel() {
return this.model;
}
protected override getPropertiesToUpdateSync(): string[] {
return ["mode"];
}
public get id() {
return this.model.id || '';
}
Expand All @@ -27,7 +24,9 @@ export class ActionComponent extends BaseAngular implements AfterViewInit {
public ngAfterViewInit(): void {
this.model.updateModeCallback = (mode, callback) => {
this.model.mode = mode;
callback(mode, this.containerRef?.nativeElement)
queueMicrotask(() => {
callback(mode, this.containerRef?.nativeElement)
});
}
this.model.afterRender();
}
Expand Down
19 changes: 12 additions & 7 deletions packages/survey-core/src/utils/responsivity-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ export class ResponsivityManager {
this.debouncedProcess.run();
};
if (typeof ResizeObserver !== "undefined") {
let isFirst = true;
let skipCallbackInResizeObserver = true;
this.resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {
if(isFirst) { isFirst = false; return; }
if(skipCallbackInResizeObserver) { skipCallbackInResizeObserver = false; return; }
DomWindowHelper.requestAnimationFrame((): void | undefined => {
this.process();
});
});
this.resizeObserver.observe(this.container.parentElement);
this.process();
if(this.shouldProcessResponsiveness()) {
this.process();
} else {
skipCallbackInResizeObserver = false;
}
}
}

Expand Down Expand Up @@ -97,12 +101,13 @@ export class ResponsivityManager {
private get isContainerVisible(): boolean {
return !!this.container && isContainerVisible(this.container);
}

private shouldProcessResponsiveness () {
return this.isContainerVisible && !this.model.isResponsivenessDisabled && !this.isDisposed;
}
private process(): void {
const shouldProcessResponsiveness = () => this.isContainerVisible && !this.model.isResponsivenessDisabled && !this.isDisposed;
if (shouldProcessResponsiveness()) {
if (this.shouldProcessResponsiveness()) {
this.updateItemsDimensions(() => {
if(shouldProcessResponsiveness()) {
if(this.shouldProcessResponsiveness()) {
this.model.fit({ availableSpace: this.getAvailableSpace(), gap: this.getGap() });
}
this.isInitialized = true;
Expand Down

0 comments on commit fc3e8a1

Please sign in to comment.