GrapesJS Issues

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

569 issues found

🔍 canvas
#1875March 10, 2019by simplecommerce3 answers
1 reactions

[QUESTION] ID changes when importing html or passing html in components prop in config.

Hi, I built a component and block that I can drag and drop in the canvas. My issue is that some styles rely on the ID. I know this might not be ideal, but it's like this at the moment. My problem is when I reload the editor with my previous values by passing it in the components prop, all my ID's are changed. Is there...

artf

@simplecommerce new release published

simplecommerce

Anyone have any idea for this issue? My issue happens when I use for example, bootstrap tabs, in order to make them work and load the right tab, it uses the ID, but since the ID is being regenerated when I load the editor with my component...

sbiwaichoon

same issue here.if i have use that id in code, id change when(id-2) reload template to grapejs (auto added "-2" to my id) , if i dont use that id in any part of my code, is fine, id wont change

#1864March 6, 2019by simplecommerce3 answers
3 reactions

[QUESTION] Best way to listen to changes on the final HTML?

Hi, I just had a quick question because I could not figure out how to do it or did not find an issue related to it. I am just trying to call a function when any changes is done on the canvas. For example, I am adding a block or removing a block. I am changing the attributes using the style manager. Or drag and droppin...

a-bashtannik

@simplecommerce , try also this, maybe fit better for you

arthuralmeidap

The way you did is the simplest way to achieve that in my opinion.

arthuralmeidap

What do you want to achieve at the end? You could use something like editor.on('all', () => //your code here ); but this is not practical at all. there are many events being triggered by GrapesJS and I don't think this will suit your needs.

#1863March 6, 2019by sakshigarg93 answers
3 reactions

Adding new components to Block Manager

I'm trying to add multiple components which are in my canvas into the block manager but I believe because of an id issue they're not visible properly. What exactly does the id refer to? Here's my code:

WebEtSolutions

Hi, Your LinkedIn sign-in id is the same that your GooglePlus sign-in. The key of block must be unique. Bye

arthuralmeidap

The id is used internally to track each block individually. As @WebEtSolutions said you should put unique identifiers to each new block

sakshigarg9

OHH alright, worked, thanks!

#1831February 25, 2019by SeongwoonHong3 answers
0 reactions

[Question] How to run command for a block component?

I'd like to do something like this. so once a user drops the test component into the canvas, I'd like to open up asset manager modal where you can upload an image by running 'open-assets' command. Thank you very much Artur

NicoEngler

To achieve this, you can listen to the drag event of the editor:

SeongwoonHong

@NicoEngler Thank you for reply! although, I'm not sure how to insert an image from image modal into the link-block component if i do this, nothing happens even after i select an image from the modal @artf Is there any way to do that? Plus...

NicoEngler

I´m afraid I can't assist further without playing around with the code myself. Though I can help debugging if you shoot up an example on codepen or similar.

#1815February 19, 2019by ateebahmed3 answers
0 reactions

[Bug]: component:mount is fired multiple times

I had been using editor events and I noticed that component:mount event fires multiple times when a component is dragged from blocks to canvas, you can confirm it in your JSFiddle Starter.

artf

@ateebahmed please don't open issues like this. Follow the template

ateebahmed

okay will reopen it

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.

#1814February 19, 2019by ateebahmed2 answers
0 reactions

[Question]: How to fire event which triggers component:selected with my component

I want to select my component whenever it is dragged from blocks to canvas and rendered, I have tried with registering events on component:add, component:mount and calling editor.select(component), passing the component I get from callback, but it is not properly initialize or has properties missing, like its type is...

artf

https://github.com/artf/grapesjs/issues/1813#issuecomment-466408328

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.

#1813February 19, 2019by ateebahmed3 answers
0 reactions

[Question]: Can't get correct component from editor.on events callback

I am using editor's events to get component after some action like component:add, block:drag:stop, but in both events I can't get my component that I dragged on canvas. when I call component.is('my-component-type'), it gives false, I need to perform actions based on its type, which I can't when I get that from event's...

artf

You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/ Next time, create a reproducible demo first, then open an issue...

ateebahmed

Actually I can't produce it with built-in components but I'm using a custom component which extends default text component, will paste the code as I could not find which property to set to get the component type, although I had set type: '...

naveen-15697

You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/Next time, create a reproducible demo first, then open an issue... @artf Here, when I drag a first component, I get three alerts. But I need only the parent...

#1811February 19, 2019by sharma-mohit-eca2 answers
0 reactions

changesCount change on clicking any element in editor

Hello, I have used changesCount to resizeEditor if any change occurs to the canvas. But when I select any element in canvas like, clicking any div in canvas increases changesCount so the editor resizes it. So, I want to disable changesCount on selecting any element, it should only increase its count when some change i...

artf

No, you can't disable it

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.

#1808February 18, 2019by MisterFK1 answer
0 reactions

Create Canvas block

Hi, Can we add a canvas block? I try and the editor create always a <div> around <canvas>. 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.