Issue #4489πŸ’¬ AnsweredOpened Jul 30, 2022by contentfree0 reactions

Loading initial project data from a designer-mode project results in wrong canvas size

Quick answerby contentfree

I can kinda force it to the correct canvas size by:Not providing projectData in the initial config, Loading the projectData via editor.loadProjectData(...) after initialization and Then running editor.Canvas.getModel().updateDevice(); though it animates from the full width back to device size. It seems that loading th...

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v103 Reproducible demo link https://codesandbox.io/s/laughing-austin-k12mc3?file=/index.js Describe the bug If you view the linked CodeSandbox and find the commented out line providing the projectData to the editor, you will see that the canvas gets resized away from the size specified by the device. In a debugger, it seems that updateDim is called multiple times at initialization: the first time with the correct device size and then again with empty width and height which then leads to the...

Answers (4)

contentfreeβ€’ Jul 30, 2022

I can kinda force it to the correct canvas size by:Not providing projectData in the initial config, Loading the projectData via editor.loadProjectData(...) after initialization and Then running editor.Canvas.getModel().updateDevice(); though it animates from the full width back to device size. It s...

artfβ€’ Aug 3, 2022

Thanks @contentfree I'll try to fix that for the next release

contentfreeβ€’ Aug 3, 2022

Thanks @artf. I'll keep my eye open for the next release (looks like your kanban board is empty now … so should be imminent?)

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @contentfree. The issue with Loading initial project data from a designer-mode project results in wrong canvas size appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, cre...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.