Issue #3642💬 AnsweredOpened July 25, 2021by Ubanna0 reactions

Multiple page manager resets device manager

快速解答by ClaudeCode

Thanks for reporting this, @Ubanna. Thanks for sharing your report about multiple page manager resets device manager. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle) Your GrapesJS version number Browser and OS information Any error messages from t...

Read full answer below ↓

Question

Hi, I have a small issue with the page manager. I want all the pages to have a fixed resolution. Height and width figures come from an API and I can successfully display the desired resolution on the single page template.

However on the multiple page template, once I switch to a different page, the device manager is reset to full screen (default). How can I achieve my aim, so that the desired resolution are correctly displayed through out all pages.

Please see below my code in React js:

useEffect(() => {
  const editor = grapesjs.init({
    container: "#editor",
    blockManager: {
      appendTo: "#blocks",
    },
    styleManager: {
      appendTo: "#styles-container",
      sectors: [
        {
          name: "Dimension",
          open: false,
          buildProps: ["width", "min-height", "padding"],
          properties: [
            {
              type: "integer",
              name: "The width",
              property: "width",
              units: ["px", "%"],
              defaults: "auto",
              min: 0,
            },
          ],
        },
      ],
    },
    layerManager: {
      appendTo: "#layers-container",
    },
    traitManager: {
      appendTo: "#trait-container",
    },
    selectorManager: {
      appendTo: "#styles-container",
    },
    panels: {
      defaults: [
        {
          id: "basic-actions",
          el: ".panel__basic-actions",
          buttons: [
            {
              id: "visibility",
              active: true, // active by default
              className: "btn-toggle-borders",
              label: '<i class="fa fa-clone"></i>',
              command: "sw-visibility", // Built-in command
            },
          ],
        },
        {
          id: "panel-devices",
          el: ".panel__devices",
          buttons: [
            {
              id: "device-desktop",
              label: '<i class="fa fa-television"></i>',
              command: "set-device-desktop",
              active: true,
              togglable: false,
            },
            {
              id: "store-data",
              label: '<i class="fa fa-save"></i>',
              command: "store-template",
              togglable: false,
            },
          ],
        },
      ],
    },
    deviceManager: {
      devices: [
        {
          name: "Desktop",
          width: `${width}px`,
          height: `${height}px`,
        },
      ],
    },
    storageManager: {
      ...
    },
    plugins: [gjsBlockBasic],
    pluginsOpts: {
      gjsBlockBasic: {},
    },
    pageManager: true,
  });

  const pageManager = editor.Pages;
  editor.on("load", () => {
    setPages([...pageManager.getAll()]);
  });

  editor.Commands.add("set-device-desktop", {
    run: (editor) => editor.setDevice("Desktop"),
  });
  setEditor(editor);
}, [slugId]);

Answers (1)

ClaudeCodeMay 17, 2026

Thanks for reporting this, @Ubanna.

Thanks for sharing your report about multiple page manager resets device manager. To help the team investigate and prioritize this:

Please provide:

  1. A minimal reproducible example (CodeSandbox/JSFiddle)
  2. Your GrapesJS version number
  3. Browser and OS information
  4. Any error messages from the browser console
  5. Steps to reproduce the issue

What helps most:

  • Minimal code example (not your full project)
  • Screen recording or screenshot showing the issue
  • Expected vs actual behavior clearly stated
  • GrapesJS configuration you're using

With these details, the maintainers can identify and prioritize a fix much faster. The GrapesJS team is very responsive to well-documented issues.

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.