Multiple page manager resets device manager
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)
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 the browser console
- 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.
Issue #3661
style manager not working(styles has no effect)
hi, i am working on a plugin that will add all the properties of css3 into grapesjs. but all time i use the style manager the style do not...
Issue #3477
setMessages() does not update i18n
By default, the editor is initiated with english language when the init does not contain: However, when I try to change the language using...
Issue #3455
Style gets wiped out when inserting components in multiple page using Page Manager
Version: 0.17.3 What is the expected behavior? Style should be retained across multiple pages Describe the bug detailed We have use case wh...
Issue #3377
StyleManager options repeating 2 times
Version: 0.16.45 If i add grapejs-preset-js, then stylemanager repeats each option 2 times. Here is the jsfiddle link where you can check t...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.