GrapesJS Issues

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

829 issues found

๐Ÿ” question
#2038May 25, 2019by Apetrou3 answers
0 reactions

Buttons flashing with question mark and non responsive.

Hi, I'm having issues using this library, firstly some buttons are missing their icons and are flashing when clicking on them they are not responsive. E.g.: Aswell when I select certain elements on the page some white blobs appear. E.g: For reference i am using the preset newsletter plugin however I have tried without...

artf

@Apetrou I think you're missing some files (those white blobs seems to be huge toolbar icons, so the font-size seems to be changed). Try to start from the file used for the demo https://github.com/artf/grapesjs/blob/gh-pages/demo-newslette...

umer936

I also have this problem. I am trying to include it in a CakePHP application. If I run my same gjs includes and scripts on a simple HTML file from my desktop, it works as expected - meaning it is not a missing include. However, including t...

umer936

Okay. After lots of trial and error, the issue is that I am already including font-awesome in my header. Unfortunately, I cannot remove font-awesome from there as I use it in many places.

#2037May 25, 2019by fmr4111 answer
0 reactions

[QUESTIONS] Toolbar error position when adding elements

I made canvas in modal, but there were a few bugs, when I added a new component, the position of the toolbar went down, the top canvas value that was initially 0 changed (console.log (r.canvasTop) in grapesjs.min.js), but when I resized the browser, everything was normal again (the bug only happens every time the page...

artf

If you encounter an error, open the issue as a bug, please. So follow the template for the bug.

#2036May 24, 2019by Gummibeer1 answer
1 reactions

[QUESTION] documentation of stored object structure

Hey, I would like to incorporate this package with my existing element based backend. To do so I would need to map the data posted to the remote storage server into my own data structure and during load also back to grapesjs structure. So for a super basic example I've took the simple heading element <h1> which is als...

artf

You can see all the Component's properties here: https://grapesjs.com/docs/api/component.html#component and none of them are required

#2034May 24, 2019by sdrebel1 answer
1 reactions

[QUESTIONS] How to remove trait fields dynamically?

Hi @artf , I have a drop down with few options. Based on the selection fields are getting generated using addTrait. Similar way is there any removeTrait function? Ex: If I choose Option1, 'field-1' will be generated. If I choose Option2, 'field-1' should be removed and 'field-2' should be added .

sdrebel

Found the solutions in the updated dev versions. component.removeTrait('title');

#2033May 24, 2019by charlieshum11 answer
1 reactions

[QUESTIONS] How to change the style of the outline of selected components

Hi @artf I can change the style of outline of a hovered component with .gjs-cv-canvas .gjs-highlighter { ...... } How can I change the outline style of a selected component? I cannot apply the style using '.gjs-comp-selected' Also, how can I change the style of the component type/name label of hovered/selected compone...

artf

Only selected component style is inside the canvas, so you have to use canvasCss option https://github.com/artf/grapesjs/blob/8915ae417bed25a4834b34d8f0ecc08f0e03fd64/src/editor/config/config.js#L74-L78 for the rest, you can use simple CSS...

#2032May 24, 2019by yrbn1 answer
0 reactions

[QUESTION] How to remove unnecessary component?

@artf you closed my issue before I approved that the answer is correct. I want grape js not to wrap the link with any block(link, text etc.). Is it possible?

artf

Please avoid opening new issues to continue the discussion of another...

#2030May 23, 2019by ohmyvander1 answer
0 reactions

[Question]Is it possible to customize a block which load data from database

For example, I want to create a complex custom navbar block. It has several first level navigations, and each of one also has several second level navigations. The data of navbar is loaded from database. And when I drag it to the canvas, I can modify properties in trait to change the data navbar loaded. Also, when I e...

artf

Sure, but in that case, I'd suggest you create a custom component. Here an example/pseudo-code of triggering an async function for changing the component content

#2029May 23, 2019by arachnosoft3 answers
3 reactions

[Question/Bug] grapesjs throws a DOMException if you import HTML contents with invalid (numbered) attributes

Hi @artf , We got a report that when you import some HTML code with incorrect attributes, such as <td class="cell" 01234="0" >Hello world! </td> grapes.js throws the following Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': '01234' is not a valid attribute name. at HTMLTableCellElement.<anonymous...

arachnosoft

Just to keep you informed, I applied the try/catch fix suggested by @ankx06 and @artf to our code, but in a generic way. I wanted to ensure that the exception would be catched in all cases when setComponents() is being called. Either from...

ankx06

@jmchaves this is not called from any event. This is the function to update component's inner components/html.

ankx06

I have also faced this issue while setting an invalid attribute/style for image height/width. Currently, I have handled using a try-catch block If the newContent has multiple components and only one component have the error, due to excepti...

#2027May 22, 2019by sdrebel2 answers
0 reactions

[QUESTIONS] How to add traits dynamically based on the dropdown selection

Hi @artf , I have a custom component with custom traits. When I select the option from the dropdown, more fields needs to be added based on the selection. How do I do it? Dropdown Extra fields Code is below, I have added the listener but not getting the option to add new fields to the current trait setting. DomComps.a...

sdrebel

I have tried this below code and it's adding in the traits array. But not reflecting in the editor. domComps.getType('linking').model.prototype.defaults.traits.push({ name: 'product' })

sdrebel

Found the solution from the latest code. this.addTrait({ type: 'checkbox', name: 'muted' })

#2022May 17, 2019by shaunc8692 answers
0 reactions

RSS Feed

Hi! I have a question, I searched but couldn't find an answer, is there a component that pulls in an RSS feed and formats it on the page. MailChimp and Campaign Monitor do this, here is an example feed: http://www.homecaredaily.com/feed/ I realize some of this is done server side, but just looking to see if anyone has...

artf

Hi Shaun, I think it should not be that complex to implement if you read how Components and Traits work. It should be something like this (take it as a pseudo-code): then add a block to let users drag it in the canvas

shaunc869

This is amazing, thank you so much!