GrapesJS Issues

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

644 issues found

🔍 components
#1480October 6, 2018by david-polak2 answers
0 reactions

[BUG]: "component:remove" event triggers when components are moved

Similar to #868 event is fired on move. https://jsfiddle.net/fnjmxyr4/

david-polak

Sorry, it does not. I was debugging the wrong thing.

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1466September 27, 2018by sfkazmi3 answers
0 reactions

Editing Saved html editor.setComponents slider load issue

I am working on a project where i integrated grapesJs for users to build there templates, save them in database and edit these saved templates. I recently added slider plugin and now user can create templates but when edit i cause issue with javascript, I am using editor.setComponents when a user edit template and add...

sfkazmi

i got a way to fix it, I directly passed the html and css content in <div>.

sfkazmi

I got a new issue, when i pass the css in <div> to render it and html, i change the style and get it with editor.getCss(); it gets the old style that i passed into style tag in <div>

artf

Read this: https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates

#1463September 27, 2018by Abhisheknanda13444632 answers
0 reactions

how to disable gjs-hoverable class from elements

hi @artf i am using your boilerplate plugin and i want to disable hoverable property from all the elements as screenshot below yellow area appearing on hover i tried to do this const updateAll = model => { model.set({hoverable:false}); model.get('components').each(model => updateAll(model)); } updateAll(editor.DomComp...

artf

@Abhisheknanda1344463 if you see "yellow area" probably because you're using showOffsets: true in your configurations (default is false)

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1459September 25, 2018by gabrigcl2 answers
1 reactions

[QUESTION] How to store "data-" attributes into the html tag of the component

Hi, I'm developing a plugin for charts using chart.js. In order to the generated template render the chart from a data model generated by the plugin, I need to store this model into the html tag of the component. The model used by the chart is like this: And have to be stored this way: However, I don't know how to do...

gabrigcl

I have seen there's method, I'll test this and close this issue.

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1448September 21, 2018by prestonkscott3 answers
1 reactions

Child component not selectable when using custom view

I'm trying to create a custom component that creates it's own view with nested HTML. I do not want this HTML to be rendered as a component so I use (using jQuery) view: defaultType.view.extend({ init: function () { $(this.el).html('<div class="container"></div>'); }, getChildrenSelector: function () { return '.contain...

artf

If you add elements via View you can't select them, only Models can be selectable Read this page https://grapesjs.com/docs/modules/Components.html you also create new types without isComponent

prestonkscott

@artf I understand how to use isComponent. I will be using fromElement: false so it's not required for how I intend to use grapes. I do not want the elements added to the view to be selected, I do however want nested components to be selec...

artf

Ok, now I got it. The getChildrenContainer should work as you expect, I'll just try to remove those pointer-events stuff and make the hover work more like the select. BTW you don't need jquery, grapesjs under the hood uses cash (which has...

#1443September 19, 2018by sapien992 answers
0 reactions

Angularjs components as grapesjs components

Hey artf, first gratulations to this awesome project, i really enjoy using it. Second: this is NOT about running grapesjs within an angular project, its more the exact opposite: grapesjs already runs fine as a angular 6 component. What i want to do is to use other angular-components within the grapesjs canvas. On the...

artf

All custom scripts loaded via canvas.scripts are loaded BEFORE components, so if you try to mount on something obviously it doesn't work. Probably you need also make use of Component related scripts

lock[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

#1436September 18, 2018by peakrams3 answers
3 reactions

[QUESTION] Atomic blocks or complex components

Hi, I'm studying the editor and I think I understand the difference between components and blocks. Now, I was wondering if GrapesJS offers the possibily to manage a block as an atomic entity or permits to define components as a tree with of nodes. For example, I have a block called separator that basically is a table...

artf

The main issue that I can foresee is that the source code should be importable so as it is generated by the editor and I'm not sure if the editor can distinguish the separator element from any td component of a table component used for tab...

artf

the fact that it has returned a type for this node prevents the editor from testing the inner nodes of this node for a component type? No, inner nodes will be still traversed, but you can actually prevent that with this as a return to your...

artf

Yeah, the content property could really solve my problem but I guess I have to manually keep it's value in sync (with string manipulation) with the changes made by the users to the properties and the traits of the separator component, and,...

#1431September 17, 2018by mrajeshkrossark3 answers
3 reactions

Load HTML file from remote

I hosted my html content in cloud. Then trying to load the html content in the editor I found the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an...

cjpollard

You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage

JulyanoF

> You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storageI tried with below endpoints that also shows errorstorageManager: {typ...

mrajeshkrossark

You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage I tried with below endpoints that also shows error storageManager: { ty...

#1429September 15, 2018by iainheng3 answers
2 reactions

Empty content when load from remote storage if components array is not empty

I have problem loading stored remote content into the editor when the JSON contains non empty gjs-components My JSON data looks like this which is very basic blockquote with a sentence of text Example response when calling my remote endpoint I am able to load the content if I set gjs-components: "" and it will load th...

artf

There is actually might be a bug, can you try to return gjs-components as a string (so try to json encode your array)

artf

Thanks @iainheng, for now, keep it like this until the next release (hope to push it the next week)

iainheng

@artf Thanks for your help. 😊 It is a bug indeed. I store the gjs-components as a string and it is working now. 🎉 This is the same data store as string

#1428September 15, 2018by peakrams3 answers
5 reactions

[Question] Define or hide properties for specific components

Hi, I'm wondering if there is the possibility to define properties for specific components. I mean, when I select the component Image I would like that in the style manager panel the section relative to the Typography is not shown; in the same way, when I select a Table component I would like to see in the style manag...

juanj

I'm not sure if this is the optimal way of doing it but you can listen to the event component:selected and if the component selected is the one you want you can add a new sector. Then you need to listen to the event component:deselected an...

artf

Actually, you can also rely on a few Component's properties made exactly for this purpose:stylable - True if it's possible to style the component. You can also indicate an array of CSS properties which is possible to style, eg. ['color', '...

artf

@peakrams the warning is actually there but the Github's Markdown doesn't let you apply custom styles to make it more visible ¯\\\(ツ)\/¯