GrapesJS Issues

3,464 parsed GitHub issues — 370 solved · 90 open. Search, filter and explore battle-tested answers.

644 issues found

🔍 components
#3455May 12, 2021by harsh2013 answers
2 reactions

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 where we save and reload the content of GrapesJS. We want to leverage Page Manager to reduce the content rendered and manage it in smaller chunks. The issue pops up when we try to lo...

artf

Hi @harsh201 styles are available across all pages, so you shouldn't use editor.setStyle (which replaces all styles with a new set) but instead something like editor.getStyle().add('...')

harsh201

Hi @artf, any help here?

ClaudeCode

Thanks for reporting this, @harsh201. The issue with Style gets wiped out when inserting components in multiple page using Page Manager appears to be a race condition or state management timing problem. This typically happens when componen...

#3449May 11, 2021by chiragkataria223 answers
0 reactions

Switching pages calls canvas styles and scripts again and again

Hi I am integrating page manager into my project. But the issue I am facing is that whenever I switch between pages it loads CSS and script files given in canvas object at the time of init, again and again. It makes the switching between pages slow. Implementation: grapesjs.init({ pageManager: { pages: [ { id: 'Page-1...

chiragkataria22

@artf Can you please help?

artf

Unfortunately, switching pages creates a new iframe so, the behavior is correct. I preferred to remove previous iframes in order to keep the memory usage as low as possible. One solution might be to find a way to reuse previous iframes but...

ClaudeCode

Thanks for reporting this, @chiragkataria22. Thanks for sharing your report about Switching pages calls canvas styles and scripts again and again. To help the team investigate and prioritize this: Please provide: A minimal reproducible exa...

#3447May 10, 2021by lbmir4 answers
2 reactions

javascripts are not working due to encoding issue

1 - I copied Typed text components code instead of demo HTML code; 2 - And added allowScripts: 1; You can see example here: http://bashworld.ru/demo.html press to View code and we see many encoded characters in JS. How can I fix this issue? I need to decode all &, <, >, ' characters, please see screenshow below

Ju99ernaut

It's not recommended to use allowScripts: 1, anyways in your case why not just drag in the typed block, but if you have to include it in your from element use:

Ju99ernaut

You should setup your storage correctly https://grapesjs.com/docs/modules/Storage.html#basic-configuration

lbmir

@artf Can you help please?

#3446May 9, 2021by Spectrevuln-sketch4 answers
0 reactions

Cannot Store Data Unexpected token '-'

Please Help Me, I Want To Store gjs data to mysql but i cannot get any data from front end to back end here my code: const editor = grapesjs.init({ container: "#editor", storageManager: { type: 'remote', params: {}, // For custom values on requests // your SERVER endpoints urlStore: 'http://example.com/store-webpage',...

Ju99ernaut

Variable names can't contain '-', so this syntax is invalid:

Spectrevuln-sketch

please help i want to store my the template to mysql how i to do it?

Ju99ernaut

Unfortunately this may be beyond the scope of grapesjs but some things to note Also since it looks like you're removing the gjs- prefix during storage, you must also add it back during loading. A similar approach is used here https://githu...

#3417April 27, 2021by NagarRahul2 answers
1 reactions

FEAT: How Map component works? How we can create weather components and render it?

Could you please expain how map components are rendered after draged? How we can create a new component for weather and how it will render like a map component? @artf

theSC0RP

You can take a look at the following (if you haven't) to understand how the map component works:Map Component ModelMap Component View

ClaudeCode

Thanks for reporting this, @NagarRahul. Great question about FEAT: How Map component works? How we can create weather components and render it?. The recommended approach with Components is to use the event-driven API. Start here: Check the...

#3416April 27, 2021by ghost2 answers
0 reactions

0.15.10 - setAttribute - is not a valid attribute name

Hello! I know this is a bug reported here #2029 but now I can not update from 0.15.10 to the version that has the solution. Would you know any workaround for this issue at the moment that I am setting the component? I am using VueJS with GrapesJS. Here is how I am trying to set the component. this.grapeEditor.setCompo...

artf

No sorry, can't help with such an old version. Why you can't update??

ClaudeCode

Thanks for reporting this, @ghost. The issue with 0.15.10 - setAttribute - is not a valid attribute name appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modi...

#3412April 25, 2021by maxtsh2 answers
2 reactions

Auto save is working partially and stops working after inserting text

hello guys. I am using this awesome project for a production app written with React.js, So I integrated it inside my app. everything works fine but I have a problem with auto saving the editor data on each change to editor. OS: Windows 10 Browser: Chrome 90 GrapesJS version: 0.17.03 latest on 26/04/2021 EDITOR INSTANC...

artf

Thanks @maxtsh for the report, there is actually an issue with those old blocks from the basic plugin which breaks the storage counter. I'll push the fix soon. For now, as a hotfix, update those blocks in this way.

ClaudeCode

Thanks for reporting this, @maxtsh. The issue with Auto save is working partially and stops working after inserting text appears to be a race condition or state management timing problem. This typically happens when component lifecycle eve...

#3410April 22, 2021by sizhousama3 answers
0 reactions

Editor's strange behavior!

When I enter the editor and use setComponents or addComponents to add components in the store, the first class of the first element will be added to the class of a certain element inexplicably. Does anyone know the reason? I need help! ! !

sizhousama

@artf

artf

That class is coming from your app so there could be thousands of reasons, we can't help you just by looking at 2 screenshots. If you think there is a bug, open the issue correctly (by following the template) and create a reproducible demo.

ClaudeCode

Thanks for reporting this, @sizhousama. Great question about Editor's strange behavior!. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look fo...

#3409April 21, 2021by ltenti-eventboost4 answers
3 reactions

[QUESTION] Custom component property that is not a trait

I would like to create a custom component with a property that will be updated by specific code, but I don't want this property to be visible and updatable as a trait; let say my property is called "ebTesto", I wrote a plugin function like that: I expected to find my new property in the "gjs-components" part of the st...

ltenti-eventboost

Thank you both!

Ju99ernaut

I think it's not stored since the property hasn't been changed from the default. The editor should be able to recover the property from the component definition itself.

Ju99ernaut

Try adding it inside defaults

#3401April 12, 2021by ahmedderkaoui3 answers
10 reactions

Can style manager always generate IDs instead of using already defined element's class ?

When we style an element in the editor, if this element doesn't have neither a class or an id, the style manager generate a new id with the css style. However, styling an element with a class makes the style manager use this class to add styles. Is there a way to always use IDs for styling and not work with classes ?...

Ju99ernaut

ahmedderkaoui

Thanks a lot!

ClaudeCode

Thanks for reporting this, @ahmedderkaoui. Great question about Can style manager always generate IDs instead of using already defined element's class ?. The recommended approach with StyleManager is to use the event-driven API. Start here...