GrapesJS Issues

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

644 issues found

🔍 components
#828February 1, 2018by maxtacco2 answers
0 reactions

[QUESTION] Components 'add' event fires different number of times

Hi, I've noticed that if I add the following code in my custom component the event fires differently depending on whether a new child component is drag and dropped from blocks vs canvas. Only one event is fired when I drag and drop a child component from the blocks section. But, when I drag and drop from canvas I can...

artf

Hi @maxtacco, unfortunately, this is due to how the Sorter works when moves components and honestly, at the moment, I can't see better workaround than your one

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.

#816January 29, 2018by arthuralmeidap3 answers
3 reactions

[QUESTION] Adds image block trough Editor API

Hi @artf , When I drag and drop a Image block within the canvas it triggers the active event for the image block thats runs the openModal method. Shows a modal to upload the image. I'm trying to run editor.addComponents({ type: 'image' }); and shows the modal to upload the image. I didn't find any API methods that pro...

arthuralmeidap

yes, you are right @artf . I didn't think about dumb cases like that you mentioned. It worked very fine to me. I just thought if was not the case to embedded such behaviour within the addComponents or somewhere else. Thanks for all the hel...

arthuralmeidap

@chiqui3d, thanks for the feedback but the image block was just an example. In my case I have created a new Type and I was trying to trigger the active event for my component. It works exactly like the image block that's why I used the ima...

chiqui3d

I think this will help you. editor.runCommand('open-assets'); https://github.com/artf/grapesjs/wiki/Assets

#814January 29, 2018by vishal50332 answers
0 reactions

[QUESTION] Disable selectable, hoverable and editable options when Mobile view is on.

Hi, I want to disable to select, hover or edit the components of the editor when the Mobile view is on. I have tried using below code. But it removes all the components from the editor. Can you please help me out? Thanks,

artf

Probably because you're passing a collection (wrapperChildren) to updateAll which expects a model

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.

#812January 28, 2018by kevinalvarez2 answers
0 reactions

Layers Manager doesn't work with several editors

Hi again! As I comment in a previous question, We're working with several editors in the same window. The issue we're facing now is that layer manager doesn't work fine when I go from one editor to another. These are the steps that make this problem happens:Editors initiatedGo to Layer Manager inside editor 1 (click o...

artf

Thanks Kevin, I've found the issue and the fix will be available in the next release

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.

#807January 26, 2018by GoodPHP3 answers
0 reactions

Help with update information in Countdown

I use "grapesjs-component-countdown" and when i chose date in calendar update information in the plugin. Example: https://monosnap.com/file/sSOQJ3M4hxVRQgj008Kl302GtXu1ah Use something like that: change: function() { console.log(editor.trigger('change:startfrom')); editor.DomComponents.render(); } Please help :)

artf

Try with this

GoodPHP

Not, it's doesn't work.

GoodPHP

Do you have any idea?

#792January 24, 2018by alvim3 answers
0 reactions

Script property using function don't work with blocks

In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said it's supported like this example: It won't happen anything. The documentation isn't very clear about using scripts in blocks or components.

artf

Find where is the issue, it will be fixed in the next release

chiqui3d

@artf These changes when they will be published?

artf

@chiqui3d should be fixed

#791January 24, 2018by lauragadea3 answers
1 reactions

Adding new button in toolbar

Hello, I am trying to add a new button to the toolbar of all the components. I been able to add for each component separatly, but not for all of them at once. To note that I want to avoide modifying the file ‘src/grapesjs/dom_components/model/Component.js’ Is there a way to do that? Thank you in advance for yur help!

artf

@lauragadea probably you should try to extend default component types (eg. default, image, text, etc.)

JulyanoF

@lauragadea , please check #266

lauragadea

Yes @JulyanoF , I already have. And it suggests modifying the files ‘src/grapesjs/dom_components/model/Component.js’. That is exactly what I am trying to avoid.

#789January 23, 2018by Geczy3 answers
1 reactions

getComponents doesn't return components

It's as if it's not parsing down the DOM Reproduce. View console log https://codesandbox.io/s/lxl7x2mnq You can see there are way more than 5 components / models in this sandbox. But console log only shows 5 If I add one to the root of the dom tree, it will show 6. But if I add one to a child component, it will not se...

artf

@Geczy probably I've to update the description, but getComponents just returns wrapper's components (with its children), if you want to return an array of all components you can do this:

Geczy

Works great, thanks

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.

#788January 22, 2018by JulyanoF1 answer
0 reactions

Insert custom CSS inline

I already tried different ways to do it, but it's still not working... First: editor.addComponents('<style>img{width:100%}.botao-roxo{background-color:#8D7EA2;border-color:#8D7EA2;color:#FFF}.botao-roxo:active,.botao-roxo:focus,.botao-roxo:hover{background-color:#FFF;border-color:#8D7EA2;color:#8D7EA2}.botao-grande{wi...

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.

#774January 18, 2018by ryandeba3 answers
0 reactions

Mimic customRTE behavior when parsing content

Hi @artf, I'd like to replicate this behavior when calling editor.setComponents("<div>This is a text component. <span style='font-size: 20px;'>This is a nested element that I don't want get parsed out.</span></div>"). In that example, I would want the nested span to not get parsed as its own component so that I cannot...

ryandeba

Now that I think through this a bit more, option 1 wouldn't really work for me since I want to prevent any inline styles from getting removed, as well as preventing any id's/classes/attributes from getting added to the child elements. So I...

artf

Hey Ryan what about this custom component

ryandeba

Thanks @artf! I bet your suggestion will work for me - I'll test it out in the next few hours.