Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(docs): flickering issues when first visit into the page (#3578)

Ran Luob0afd99f4a82
diff --git a/packages/docs-ui/src/services/doc-page-layout.service.ts b/packages/docs-ui/src/services/doc-page-layout.service.ts
index 2f11bf26ab..271e8da579 100644
--- a/packages/docs-ui/src/services/doc-page-layout.service.ts
+++ b/packages/docs-ui/src/services/doc-page-layout.service.ts
@@ -72,6 +72,13 @@ export class DocPageLayoutService extends Disposable implements IRenderModule {
scene.resize(sceneWidth, sceneHeight + 200);
+ // the engine width is 1, when engine has no container.
+ // Use to fix flickering issues into the page.
+ if (engineWidth <= 1) {
+ docsLeft = Number.POSITIVE_INFINITY;
+ docsTop = Number.POSITIVE_INFINITY;
+ }
+
docsComponent.translate(docsLeft, docsTop);
docBackground.translate(docsLeft, docsTop);