Issue #2834Opened June 16, 2020by kuhelbeher6 reactions

[BUG] Grapesjs doesn't initialize styles for wrapper

Question

Hello, I've met a bug where grapesjs doesn't initialize styles for wrapper. Steps to reproduce:

  1. Go to https://grapesjs.com/demo.html
  2. Select wrapper and set background. It will add "body" rule to styles and it will be displayed in style settings
  3. Refresh the page - "body" rule still present (you can check it in "View Code" modal) but it didn't applied to the wrapper simplescreenrecorder-2020-06-16_15 23 25

Also it is causes in my project similar problem to this - https://github.com/artf/grapesjs/issues/2231

Answers (3)

bryanjamesmillerJune 20, 20223 reactions

This seems to fix the issue:

const wrapper = editor.getWrapper();
wrapper.set('attributes', { id: 'grapes-iframe-body' });

Any reason not to do this @artf ?

JowceySeptember 29, 20232 reactions

Hey, this issue is still persisting. The Classes and CSS added to the body layer (wrapper) get wiped every time it's restarted. It seems to be that the ID get's randomised and that's why the CSS breaks, but unsure why the class gets cleared.

aakash2610March 31, 20221 reactions

I am facing the same issue. Is there any workaround for this issue suggested by grapesjs team? Meanwhile, is there any timeline for fixing this issue?

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.