GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#2661March 16, 2020by h3llomoto2 answers
0 reactions

[BUG] toggleStateCls returns js error

Hi there, guys. I found a bug at the LayerManager: I've got an html comment as a layer in the LM. I click the comment. I get an error at the console: And the code this error relates to is: src/style_manager/view/SectorsView.js:47 So, html comments cant have classList property and this is the bug.

artf

Can you create a live demo, please? By default definition, you shouldn't be able to see Comment component in Layers

no-response[bot]

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...

#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!

#2658March 16, 2020by vectaankit1 answer
0 reactions

ERROR TypeError: r is not a function

Grapesjs working absolutely fine at my local end as well as at yarn build --aot, but once we done with yarn build --prod, once we opening editor showing me can please help me to resolve this issue?

artf

Sorry but that chunk of error, pasted like this (without the stack, file reference, etc.), tells absolutely nothing, it might also be an error in your source

#2657March 16, 2020by Podvodila3 answers
0 reactions

[Bug]: custom style property is not working when toRequire attribute is set

Are you using the latest release (older versions are NOT supported)? YesWhat is the expected behavior? Custom style property applying to componentWhat happens instead? Custom style property is not workingSteps to reproduceselect Box componenttry to change Box Width style property (under Custom tab) When I add custom s...

Podvodila

I managed to hotfix it by extending isTargetStylable method inside PropertyView.js - https://github.com/artf/grapesjs/blob/85b7b82103e12fb01a3700b1002a57a7b60ccaf1/src/style_manager/view/PropertyView.js#L504-510 I replaced thisif (toRequir...

Podvodila

Offtop I don't want to create another topic, just want to say that in the same method(isTargetStylable) that would be better to replace searching for property with id(as I understand for the built-in styles, it is the same as the property)...

artf

would be better to replace searching for property with id(as I understand for the built-in styles, it is the same as the property) inside unstylable(as well as stylable) check Yeah, totally correct! Honestly, I use toRequire option and nev...

#2656March 16, 2020by abozhinov3 answers
1 reactions

[BUG] Wrong position of toolbar when duplicate children component

Hi, you can check this example: https://codepen.io/abozhinov/pen/XWbqjEJ Steps to reproduce the problem:If components existing delete them all.Drag a new carousel block. Select the first children's container.Click on the DUPLICATE icon to create a new component.After that try to select the newest component and then se...

abozhinov

When overwrite these two methods in 'select-comp' command everything works perfectly. The problem was that "el" doesn't exist in the DOM. ` onHovered(em, component) { let result = {}; if (component) { const { view } = component; const { el...

abozhinov

The same result you can get when trigger render instead of reset.

abozhinov

@artf if you try on the demo is the same. Just drag the carousel and click on the slide. <img width="1440" alt="Screenshot 2020-03-16 at 14 58 23" src="https://user-images.githubusercontent.com/1404839/76760669-b8b75780-6796-11ea-8e24-8946...

#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

#2654March 15, 2020by AbdiasM3 answers
6 reactions

How to get the changed property from StyleManager

Hi, Is there a way to find out which property was changed in the StyleManager? For eg. If I select a Text component and change its background-color property from the StyleManager, is there any event where I can get the property that was changed. I've tried the 'component:styleUpdate' event, but it passes the component...

pouyamiralayi

@AbdiasM i think this is kinda backbone related stuff and to my knowledge currently not possible. This is how it should be: Cheers!

artf

Actually, you get the changed property as a second argument of the callback

pouyamiralayi

Hi @AbdiasM based on component:styleUpdate or component:styleUpdate:{propertyName} you can get the property like below: Cheers!

#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...

#2650March 14, 2020by abzal03 answers
2 reactions

Slick.js reload the slider on image asset change

Hello everyone, I am integrating slick slider, the issue is with reloading the slider after image is uploaded. After onclick of open assets the Slick slider must be reinitialized so that regular html of the slider would become slick slider, that happens on adding the component to the canvas only: $('#slickslider').sli...

pouyamiralayi

Hi @abzal0 the correct function is actually `updateScript my bad! here is how i did it: first defining the component type: Every time the script runs, i reset the slickjs for the sake of re initialization which you can see in the script. I...

abzal0

@pouyamiralayi this is incredibly valuable code, thanks a lot for sharing it :) it works better than I needed. Will be sending you an email, hopefully you will reply.

pouyamiralayi

@abzal0 how to reinitialize 'script' function inside editor.blockmanager.add to reload the jquery code of slider? for your `script` code, i suggest you move it to the component definition and in there, you can issue: for script reloads. Ch...