GrapesJS Issues

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

829 issues found

๐Ÿ” question
#2744April 28, 2020by jcze913 answers
0 reactions

[QUESTION] Disable a block drag&drop

Hello everyone, I would like to make forbidden the drop of one block before another specific one. Context : i've create a new trait for some blocks to set them as "page header", and I don't want to allow the drag&drop one block before this "page header" as it must be the first block of my template. I saw I could liste...

artf

From the latest release https://github.com/artf/grapesjs/releases/tag/v0.16.12 you can pass disable property to your block

jcze91

Hello, Thx for your response but it's not my use case. I don't want to disable a block drag'n'drop on all the canvas, but I jus want this block to not to be added before another specific component.

artf

You can see if you're able to achieve it with by using the draggable property (Component) or make use of block:drag:stop event to ensure if the dropped component meets the necessary criteria and remove it if it doesn't

#2743April 28, 2020by andy-aware1 answer
1 reactions

[Question] Asset Manger not updating

I've read the API and it says that we can filter assets by attributes. Cool! but I'm having trouble getting the asset manager to update: I'm running the following: I have 2 images loading in my asset manager on editor.init - both images have the attribute: category: 'cat-X' I want to just load cat-1 but this just does...

artf

Hi @awaredigital I can't see any issue on my side. If you open the Assets modal and run this code in the official demo you'll see it updating correctly So probably you'll need to create a reproducible demo with your case to see what is wro...

#2742April 28, 2020by ghost3 answers
1 reactions

[QUESTION] How to prevent unique ids generation?

Hi! Thanks for your work @artf. This is a simplified code of how I use grapesjs, I want to save the styles and then want to apply them again. The problem is that ids already changed in DOM after first call of container.components() so styles will not be applied. How to prevent this behavior? What should I clear/reset?

pouyamiralayi

Hi @nikita-balakirev see if #2706 comment can help you. Cheers!

ghost

I fixed it now using editor.DomComponents.componentsById = {}; but I think it can lead to collisions between blocks at some point what do you think?

artf

Sorry @nikita-balakirev can't help you here without a complete reproducible example. When you export components as JSON all IDs are preserved and reused if load correctly, so for sure you're doing something wrong with storing/loading data....

#2739April 27, 2020by andy-awareNo answers
0 reactions

[Question] Asset Manager Folders

Hi, I've been looking to implement folders for the asset manager like this question: https://github.com/artf/grapesjs/issues/229 However, I can't find anywhere in the documentation to do this. And feel like I'm going around on myself. Any help is appreciated. Thanks.

#2738April 26, 2020by adamwpe3 answers
2 reactions

[QUESTION] Keep Hover state when amending the child

I'm trying to edit a dropdown list option, and it's quite difficult to style it because you cannot move your mouse to the Style Manager since the hover will disappear. So is there a way to keep the hover state active when amending a child? I know you can style using the Layer Manager - but that's not as user friendly,...

adamwpe

@artf Thank you! I made an example of a working Drop Down List for anyone who comes across this. https://jsfiddle.net/f74zqpgx/ Adam

Ju99ernaut

Had tried this, but realized you can only edit the styles for the hover state.

Ju99ernaut

You can also just select the div.dropdown-content and set its display to block in the Style Manager then set it back to none when you finish editing.

#2733April 23, 2020by randohinn3 answers
1 reactions

[Question]: Seeing weird behaviours when implementing grapes on my site

I'm trying out a very simplistic implementation of grapes. And the only block required by the automatic require at the end is: Having two issues and a question: 1) Removing a class from the style editor, wipes the rest of the style... 2) Adding a second block, after changing the first block's properties.. does not add...

Ju99ernaut

Hi @randohinn, 1) I assume removing the class isn't wiping the style but it removes the styles associated with that class from the block, try adding back the class and see if the styles come back 2) By default if a block has a class, all t...

arretnet

Hi, I've the same issue since this morning. Yesterday, and previous days all was right. Best regards

arretnet

Sorry, nothing is wrong. I've made a modification on a component generating the issue

#2730April 22, 2020by Lerdouille3 answers
0 reactions

[Question] Update Traits properties on a plugin

Hi, is it possible to change easily some properties in the Traits configuration of a plugin ? I"m trying to translate some strings in the grapesjs-echarts plugin, and i kindy stucked after reading your documentation and looking for the functions to do so... Could please tell me if it's possible to change some options...

artf

You should be able to do it via i18n module

Lerdouille

Hi, thank you for the answer. I agree with you, it changes indeed the default labels on Traits (. But what about a plugin, or a component not added in the i18n module ? For example, the type "map" include in your initial javascript, how ca...

Lerdouille

Hi again, any idea to help me to update traits default properties after the plugin initialization ? In my previous sampe, i have a hard coded type 'map' in my grapes.js , i would like to update some traits properties in my html page with s...

#2729April 22, 2020by DaithiLynch3 answers
0 reactions

[Question] Updating to latest verion

I updated to the latest version 0.16.3 from the downloaded newsletter 0.10.7 , the test-form for sending a test mail does not work in the newer version, actually it seemed to have stopped working after verion 0.10.8 , , the form itself seems to be appended to the end of the screen when opened

artf

Yeah that thing was dropped years ago (the service on which it was relying disabled the possibility to use it in that way)

DaithiLynch

Hi Arthur, Thanks for reply, It is not the sending that is the problem, I have that covered, it is the showing of the actual modal that is the issue, the send button is missing along with the subject , no matter what I tried to do, it will...

artf

don't try to reuse that modal, just create your own...

#2728April 22, 2020by ajumell1 answer
0 reactions

[QUESTION] How can I set the background image of a component programtically.

Hello, I want to create an option to change background of a component by double clicking it. I could open the modal when double clicking it. But how can I se the background-image property using it. I checked the codebase couldn't find a clue. Have any one done something similar. Please provide some suggestions or lead...

artf

@ajumell when, for example, you select the background to apply you can change the component background in this way