GrapesJS Issues

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

829 issues found

🔍 question
#2677March 23, 2020by verloka3 answers
5 reactions

[QUESTION] How to delete a list with devices

How to delete a list with devices?

teawithfruit

Next time you can try to use the search function... ;) #875

verloka

Next time you can try to use the search function... ;)#875 thx

teawithfruit

You have to set a custom device manager configuration in your init block. https://grapesjs.com/docs/api/device_manager.html With this snippet you can clear the list.

#2674March 20, 2020by teawithfruit3 answers
1 reactions

[QUESTIONS] i18n content integration

Hello, I'm working on an integration of my localization system (i18n) with grapes.js. The idea is to have a data field, which will hold the i18n string. If the data attribute is set, grapes.js will take the string and make it visible in a settings field. If the settings field is altered, the data attribute is also alt...

artf

@teawithfruit if you expect something in your saved HTML page (outside of the GrapesJS editor) the only thing I see it can do is: So it does nothing, probably you're another victim of thinking that scripts inside GrapesJS editor will work...

pouyamiralayi

Hi @teawithfruit there are a couple of issues with your code: 1) you don't have access to `this as the model inside component script`: Component & Js docs 2) if your use case is to control an attribute, you don't have to provide a custom t...

teawithfruit

Thank you for the very helpful the answer! This is my updated Block/Component. Right now I've got just one more problem. The script function I've added to the component is not called in the saved html page. If I add the block to the canvas...

#2673March 20, 2020by qtarant2 answers
4 reactions

[SOLVED] [QUESTION] Function to refresh DOM tree after component changes

Hello. I am developing a site using this amazing software. Now, I am customizing the editor and I have found a task that I am not be able to carry on. I am using the ckeditor plugin and it works as expected. In the ckeditor toolbar I have the option of insert images inline the text. It works well, but the problem is t...

qtarant

I have already solved my problem. The key code is the event "rte:disable" that is fired when the Rich Text Editor (rte) is closed. And another important thing is that the content that it has been edited is not in the component model, only...

pouyamiralayi

@qtarant check out #2537 comment Cheers!

#2671March 20, 2020by TrungLeIT2 answers
0 reactions

[QUESTIONS]: how to handle more sector of traits

I want to add more Structure sector as below : // Add Settings Sector var traitsSector = $('<div class="gjs-sm-sector no-select">'+ '<div class="gjs-sm-title"><span class="icon-settings fa fa-cog"></span> Settings</div>' + '<div class="gjs-sm-properties" style="display: none;"></div></div>'); var traitsProps = traitsS...

artf

At the moment you can render only one container of traits, so you can't split them

gunslingor

I'm confused about the demo and this answer. Why is it that I can configure the general, dimension, etc sections at init but not Settings/Traits or others. Also, you can't add arbitrary sections to the presets during init? I'm surprised, e...

#2670March 19, 2020by kohki-shikata1 answer
1 reactions

[QUESTIONS] Doesn't appear HTML class name of a custom block on editor

I added my block like this below Then drag this block and drop to canvas, and show HTML code with export-template command. 👆OK, this is what I expected. BUT, HTML class doesn't appear on the element inside of the editor, so it's not applied style for .main-title. <img width="793" alt="スクリーンショット 2020-03-20 2 36 53" sr...

artf

Classes should be placed in classes

#2660March 16, 2020by just-vicu2 answers
1 reactions

[QUESTION] Reinit model's components function

Hello guys, I have a custom component with different structure based on prop's value. How can i recall/reinit model's components function on prop change event. Thank you in advance.

artf

I think this.components(this) will throw the Maximum call stack size exceeded error as you're trying to append the component to itself. Probably you have to try this I'd probably suggest, in this case, to isolate the function to make thing...

pouyamiralayi

Hi @V1cu you can register your listeners inside the init hook like below: Cheers!

#2655March 16, 2020by Hsin903213 answers
0 reactions

[QUESTION] How to editable in innerHTML

hello, I want use blockManager to created component. I had run the dotted line, that's great and I can see this. then , this is my component code that's run perfect like this image. I can edit text and see the dotted line in class .chs-row-cell today ,I want add resizable in this component (only this component can res...

Hsin90321

I find the problem is not dotted line ,the problem is innterHTML!!! the innterHtml let my component can't edit. I want use modal to show input let view change. restart render view the work is perfect. but I still can't edit. there is my co...

Hsin90321

hello, I'm find the answer for editable in #460 now,the component can edit text. but, still not show dotted line.

artf

You have posted a lot of questions on the same issue and you should avoid it. Create a live demo with the issue. BTW, in your original post you've made a mistake

#2651March 14, 2020by orionseye3 answers
0 reactions

[QUESTION] Background image via inline style not accessible?

This is very simple, but i can not access the background image set via CSS, within my custom block 'content'. How do i change the background image here? (even editor.getCss 'sees' the style) https://codepen.io/dimimet/pen/NWqYmbB Cheers!

orionseye

Strange .. i have explicitly to use specific class to access the background image (in my case it's class .bg) #desc-text-6 .bg will not work. Now, since .bg is a global style declaration, i need to make use of #desc-text-6 .bg Even adding...

orionseye

Never mind.. reading half of the issues here, i saw that there is a little 'checkbox' next to the selected classes, which let me toggle the class view on/off. That way, i can add unique class now and assigned my bg-image to that ..then cli...

artf

Now, since .bg is a global style declaration, i need to make use of #desc-text-6 .bg No, actually there are absolutely no good reasons to use a selector like this #desc-text-6 .bg, just create a single class for your element and point your...

#2647March 13, 2020by jcamejo3 answers
3 reactions

Drag placeholder does not calculate the correct width.

HI @artf, I hope you are having a nice day. There's a small issue with the drag placeholder when a block is being dragged into a possible container with lateral margins, It could happen also with top/bottom margins or padding but I'm not 100% sure. <img width="1107" alt="image" src="https://user-images.githubuserconte...

artf

To be honest, I'd leave getElRect as it is, using getComputedStyle in this context would be too much expensive and the function itself is a generic one (so it doesn't make sense having there stuff like boundingRect.width = boundingRect.wid...

jcamejo

I got to getElRect by reading through the getDim function but i will do the research there again to look for another solution. Thanks!

bgrand-ch

Hello, For future questions or technical issues, which aren't bugs, GitHub's Discussions tab is the place to be. Don't forget to close this issue if it is resolved or write a new detailed message in Discussions -> Q&A category (and close t...