GrapesJS Issues

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

3464 issues found

#3509June 1, 2021by theSC0RP1 answer
1 reactions

QUESTION: How to programmatically change componentFirst?

Hey @artf, I was trying toggle between using ids and classes for styling so I need to change the componentFirst attribute programmatically. But when I try to change the config, the behaviour doesn't change. This isn't working even in the demo. Steps to reproduce:Add two text blocksGive them the same class name.In the...

artf

You have to retrigger the selection after changing that option editor.trigger('component:toggled')

#3508June 1, 2021by tranthanhhoa1 answer
0 reactions

BUG: Layer visibility does not work properly

Version: 0.17.4 How to reproduceSwitch to tablet or mobile modeHide the selected component by toggling the visibility icon of LayerSwitch to desktop mode. ResultThe visibility icon is still disabled while the hidden components is showing. ExpectedAfter switch to desktop the visibility icon is enabled.

artf

Thanks for the report @tranthanhhoa I'll fix it in the next release, but I think I'll keep the visibility change more like a global condition, so the hidden component won't be visible on all devices.

#3507June 1, 2021by cedriclajato1 answer
0 reactions

No Generated ID and No auto select ID

Hi Guys, I am using grapesjs-blocks-bootstrap4 and I check how they component it's looks fine. But when you select block like container it targets the class instead of Unique ID. I was able to setup random ID using this model.set('attributes', { id: randomID() }); but still when you select the block it targets the cla...

artf

https://github.com/artf/grapesjs/issues/2936#issuecomment-680322089

#3506May 31, 2021by iabhiyaan2 answers
5 reactions

FEAT: add click event on blocks

Or Is there any way to listen for click event in block ?

artf

Well you can actually make use of custom render from blocks to apply custom DOM events.

YyueeiWY

<pre> editor.on('component:selected', (some, argument) => { console.log(some, argument); }) </pre> https://grapesjs.com/docs/api/editor.html#available-events

#3504May 31, 2021by snowballrandom1 answer
0 reactions

BUG:

I noticed that an earlier version of font awesome version 4.7 is being used. I use version 5.2 of fontawesome and it seems to cause issues when loaded alongside the version used with Grapes JS some of the fonts are not loading or class names have changed in the new fontawesome character set. How can I use the newer ve...

artf

You can change this option on init: https://github.com/artf/grapesjs/blob/88249c38577852dc3c42047356a70a12066ee6ca/src/editor/config/config.js#L165-L168

#3500May 28, 2021by vijayshukla301 answer
0 reactions

Remove custom trait by its type.

I have created a custom trait but the name of that trait will be dynamic which is unknown. The problem is that the current removeTrait() only works with name/id. But what if I want to remove all traits from the component with custom-trait. Ex: I create a trait 'my-custom-trait' and bind it to the component. component....

artf

You can use of the ID

#3497May 28, 2021by mosh-tudor1 answer
1 reactions

BUG: Button trait command doesn't work

Version: LatestDescribe the bug detailed https://jsfiddle.net/cleaver/wgz2jsvq/2/ Nothing happens on: --- On version 0.16.45 the same code worked fine: https://jsfiddle.net/cleaver/kenvpt50/1/

artf

Thanks for the report @tudor-ooo will be fixed in the next release

#3496May 28, 2021by anlumo3 answers
1 reactions

FEAT: Mark Component as Dirty

What are you trying to add to GrapesJS? Component should be able to mark themselves as dirty, triggering the onbeforeunload warning message. Describe your feature request detailed I have a (custom) text component where the user can enter arbitrary text. I'm storing the data on my server, and I want autosave. However,...

anlumo

I worked around this by completely disabling the onbeforeunload handling and rolling my own.

artf

The editor has editing property which changes any time RTE is enabled/disabled, so I guess, in your case, this should work

anlumo

Wouldn't this onbeforeunload handler be overwritten afterwards by the snippet I referenced above?

#3491May 27, 2021by TheDude701 answer
0 reactions

BUG: iframe does not save src / does not recognize iframes after load

Version: 0.17.4 Are you able to reproduce the bug from the demo?[ ] Yes[X] No What is the expected behavior?After inserting an iFrame that the src will be returned when using editor.getHTML()When loading a page that iframes will be recognized as iframe component and become editable again Describe the bug detailed Am a...

artf

I'll add iframe support in the next release