GrapesJS Issues

3,464 parsed GitHub issues โ€” 370 solved ยท 90 open. Search, filter and explore battle-tested answers.

644 issues found

๐Ÿ” components
#2970August 24, 2020by MarksEliel1 answer
1 reactions

Problem inserting components at the end of the editor

Increase margin between components or insert a margin at the end of the editor. I have a problem when adding a component, it goes inside the front div.

RJCAM

Hi @MarksEliel Please follow the default guide when making a bug report to better understand your issue.WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/g...

#2963August 19, 2020by jamejillagit2 answers
1 reactions

Template loaded via remote storage is not displayed in the editor

Hi, I am trying to load a default template from remote storage into the editor but nothing is displayed. As part of of the initialization I have this code: storageManager: { type: "remote", autosave: true, autoload: true, stepsBeforeSave: 3, urlStore: "https://myendpoint/lib/remotestorageloadtemplate.php", urlLoad: "h...

mcottret

Hi @jamejillagit ! According to how DOM Components are loaded, it seems like GrapesJS will prioritize loading from the gjs-components property over the gjs-html one as long as it is defined & valid (array, object or JSON string). If you ex...

artf

@jamejillagit be sure to have read this https://grapesjs.com/docs/modules/Storage.html If you're loading back the HTML to update the template, you'll face issues

#2961August 18, 2020by kuhelbeher3 answers
1 reactions

BUG: Components in custom modal isn't editable

Hello, I'm trying to add custom modal block to my project and I want to change content of this modal also with drag&drop. Here's code of my modal block: The problem with this code is that grapesjs wraps whole content with div wrapper when user drops it on canvas and everything inside this div isn't editable, selectabl...

Ju99ernaut

Maybe use the layers panel or disable the script using a trait as shown on issue #2772

Ju99ernaut

I think the content field is treated as plain text so use the components field instead:

kuhelbeher

@Ju99ernaut thanks for great suggestion. It worked. But now I have different problem - how can I select "Open modal" button for styling or modifying? When I click "Open modal" button it opens modal. Can I somehow prevent firing this event?...

#2954August 12, 2020by ghost1 answer
0 reactions

BUG: Cannot run preview mode when test with Jest

Version: 0.15.10 Hi! I am using Jest for testing my Grapes.js components. I need test my components behavior in a different environment like an edit mode and preview mode in Grapes.js editor. When I test in edit mode everything is fine but when I need test in preview mode I try to run script editor.runCommand('preview...

ghost

I forget to add editor wrap element in current document so editor initializing by me was not existing in DOM The solution on 12 line: <img width="488" alt="solution" src="https://user-images.githubusercontent.com/48758473/90397413-77f2a000...

#2953August 11, 2020by cartifon2 answers
0 reactions

BUG: Error when navigating out from Grapes with something selected.

Hey @artf, Steps: Open Canvas with GrapesJS, select any of the components, then click on Go to Random, I get an error that says "Cannot read property 'models' of undefined". This only happens if I call the editor.destroy() before navigating to a different page. But if I remove the destroy, it works fine... Demo: https...

artf

Thanks @cartifon should be fixed in the next release

Nelida27

Hello, I have the same problem now that I moved to latest version. Should I call editor.destroy()?

#2952August 11, 2020by krishnaeverestengineering3 answers
0 reactions

Custom component is not working after saving.

Hi, I have Button-Link custom component created, and when I dragged into canvas for the first time component is detecting its attributes and styles. But after saving the component and reloads the page, custom component type is missing from that component instead its showing Link type component. How to preserve the cus...

DmitryTar1

You should add some type to your component and then parse it in isComponent For example the similar button link const components = editor.DomComponents; const link = components.getType('link'); components.addType('custom-link-button', { mo...

Ju99ernaut

@krishnaeverestengineering How are you saving and loading your work

artf

Read the documentation please https://grapesjs.com/docs/modules/Storage.html

#2949August 10, 2020by v8jupiter1 answer
1 reactions

REMOVE: How to wrap html of video component into 2 div`s, and why toHtml not called?

Hello, Can someone help me. v0.16.17 I need to change html for video component to structure: I am trying to override toHtml method but they never called... // Get DomComponents module let comps = editor.DomComponents; let bm = editor.BlockManager; // Get the model and the view from the default Component type let origi...

v8jupiter

my error

#2943August 7, 2020by Joshmamroud3 answers
1 reactions

BUG: this.get('content') returns empty string when trying to add custom component type

Version: 0.16.18 Are you able to reproduce the bug from the demo?>> Demo <<< [ X ] Yes [ ] No What is the expected behavior? Expecting this.get('content') in the context of the model while creating a new component type (extending the default component type) should return the children as HTML. Describe the bug detailed...

artf

No, content property is only used in components like Text/Textnode. Replace your this.get('content') with this.components().map(comp => comp.toHTML())

Joshmamroud

@artf does this look like a bug or am I doing something wrong?

DmitryTar1

@artf does this look like a bug or am I doing something wrong? May be try model.components() insead of content

#2941August 6, 2020by nhh1 answer
0 reactions

QUESTION: Why does the editor itself not using `gjs-html``for canvas representation?

Hey, we are currently using grapejs to create liquid templates (shopify syntax). The way its currently implemented will leave the template, for example `{{ name }}, unrendered within the editor. This is due to the fact, that even if the gjs-html gets interpolated by the server after a store/load cycle, the editor stil...

artf

Well, if you load back the HTML you'll lose all the component information (kind of explained here). As an analogy, try to think about Photoshop files and JPG as an output. If you load back the JPG you won't see the layers used in your Phot...

#2940August 6, 2020by jcamejo1 answer
0 reactions

RemoveChildren in Components.js being executed with an undefined component

Hi @artf long time, I hope everything is going good with you and your closed ones. There's a small case that I wanted to ask what you think before i make a request. I have a custom link component that is wrapped around a li tag, this link has an event to remove its parent li when is removed. If i delete the link direc...

artf

Thanks Juan, all good and I hope the same to you :)This can be solved by just returning if the removed param is falsey but maybe it's too hackish and i should look for another solution and not make the component delete its parent. Well, te...