GrapesJS Issues

3,464 parsed GitHub issues โ€” 370 solved ยท 90 open. Search, filter and explore battle-tested answers.

829 issues found

๐Ÿ” question
#1895March 15, 2019by simplecommerce3 answers
0 reactions

[QUESTION] Drag component over canvas with script, script appended multiple times.

Hi, not sure if this is a bug or not. But I noticed a weird behavior, when I drag a block that has a component that contains a script function, it seems to append it into the canvas before its being dropped. And as you drop it, it appends another time, the script. If you never drop the block and just drag over and out...

simplecommerce

So I dug around and figured that it was the updateScript method in the canvasView that was being called every time a script property is found on a component, regardless if its still being dragged or not over the canvas. I did some patching...

simplecommerce

My previous solution did not work, so I had to scrap it, so I re-opened the issue.

artf

Hi @simplecommerce if you think it's a bug, please open an issue by FOLLOWING the template and create a reproducible live demo of the issue. It's really important because as we don't have a lot of free time we risk to waste a big part of i...

#1893March 14, 2019by trivago-vgarcia3 answers
1 reactions

[QUESTION] Have to have all the blocks the same styles by definition

We are using blockManager, as you can see in the example posted to codesandbox, following the documentation related to custom render. The unexpected behavior for us is that each time a user edits the styles of a block, all blocks are updated with that style, because the style has been set to the class used in the bloc...

artf

First of all, your example/problem has nothing to do with the custom render in blocks (you'd use it to customize the UI of blocks not components in the canvas). A solution is to set that class private

trivago-vgarcia

@artf Thanks for the reply! Sorry, because the example wasn't clear. It happens on every case, I mean, even when they are defined in the default template, and not only when a new selector is added. So, using selector:add wont fix all the c...

artf

It happens on every case, I mean, even when they are defined in the default template, and not only when a new selector is added. So, using selector:add wont fix all the cases. selector:add is triggered even when a new class is added from p...

#1892March 14, 2019by sanjib002 answers
0 reactions

[Question] Flexbox column is not working correctly.

Hi @artf , We are using flexbox block. The problem is, when we are trying to resize the middle column it affects all other columns, like automatically reducing the width of left column. It should affect the right column only. To create this scenario please add three columns and try to resize the middle one (https://co...

artf

This is how the flexbox is supposed to work when you resize a middle column. What you're trying to achieve is a bit different and would require another kind of implementation, so I'd suggest to create your grid components

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.

#1890March 13, 2019by MACscr2 answers
0 reactions

[QUESTION] Disable Drag Feature, Not Ability

I want to create my own dragging and placement abilities. I love grapesjs, but really want more control over how dragging elements work in the editor area. Is there a way to disable the built in method so that I can create my own? I know the designer mode is on the roadmap, but I need the feature now, so I am going to...

artf

Well, for the component itself, when you click on move icon, it runs the tlb-move command so you can actually overwrite it by adding a new one with the same ID, but unfortunately there is no easy way to change the drag behaviour of blocks....

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.

#1888March 13, 2019by RobertoCorreale3 answers
0 reactions

[Question] Add custom html inside canvas

Hi there, I'm using grapes to export a custom json with all the information i need, instead of HTML and CSS. For doing that I'm parsing the gpjs-components stored on localStorage. Now iI need to customize how components are rendered inside canvas. For example I have an Input component with two traits (label and value)...

artf

I think is because adding new nodes inside the canvas, grapes cannot calculate the correct order. Correct, the order is based on components in the model, not the view. So, just to be clear, that <label> you're adding in updateComponentView...

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

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.

#1882March 12, 2019by nethzor2 answers
0 reactions

[QUESTION] Dynamically changing Trait Properties

Hi, I went through the other questions posted here and could not get it to work. All I need to do is to access a specific trait of a specific component (or selected one) and to set some of its attributes. I default the trait to display: none and when I did some server logic the trait gets a value and is displayed to t...

artf

Please read carefully this https://grapesjs.com/docs/modules/Traits.html and check your code, it's a bit a mess (you're mixing component code inside traits)

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.

#1880March 11, 2019by Gianglo2 answers
0 reactions

[QUESTION] Disable drop only for a specific block

Hello, There is a way to specify the blocks that should NOT be able to be inserted within a specific droppable block?

artf

Yes, you can specify a component with a draggable property like this *:not(.cant-insert-here)

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.

#1879March 11, 2019by lyczos2 answers
0 reactions

[Question] Traits manager - image type field.

Hello, I want to add a new field in traits manager (components settings). This field should select an image from the assets manager and retrieve back URL link to the image)after selecting an image from assets). I just want to ask is there any smilar built-in solution in current GrapesJS version?

artf

I just want to ask is there any smilar built-in solution in current GrapesJS version? Unfortunately no, maybe one day we'll create a common module for UI elements but currently, there is no one, so you have to create a new custom trait.

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.

#1876March 10, 2019by VardanNersesyan2 answers
0 reactions

[QUESTION] export to pdf

Hi all, 1) Can I use this framework for generate pdf file after editing html page? And how can I do it? 2) Can I make ready templates and provide it for editing by user via framework? And how can I do it? Tnx.

artf

Can I use this framework for generate pdf file after editing html page? And how can I do it? There is no built-in command to generate PDF for you but you can get the HTML code of the template and generate the PDF from itCan I make ready te...

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.

#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