GrapesJS Issues

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

644 issues found

๐Ÿ” components
#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.

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

#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

#1872March 9, 2019by kickbk2 answers
0 reactions

Clicking enter inside a text components many times

Something goes crazy when the text area extend beyond a certain point. I don't know exactly how to describe it so I'm including a screen recording. To reproduce, go to https://grapesjs.com/demo-newsletter-editor.html, enter a text component that is close o the bottom of the viewport, go to the end of the text, and kee...

artf

CKEditor bug (indeed the default RTE is ok), probably related to the element being in the iframe (unfortunately a lot of text editors fails by not considering this aspect) At some point it starts highlighting other components and acting al...

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.

#1868March 7, 2019by sakshigarg93 answers
1 reactions

How to enable functionality only for specific image component, not all

I've enabled the fa fa-pencil icon into my image components, but I want it to be enabled only in specific image components, not all of them. How can I achieve that? This is my code

arthuralmeidap

You are on the right path. Yes, you have to create a new component for that but you can't override the Image component type otherwise, as you have seen, all the images will get that. What makes those images unique? How could you differenti...

sakshigarg9

I tried this and removed gjs-data-type="image" from the img tag where i want the functionality to be applied. But, neither does it implement the functionality on it and but also messes with the rest of component properties.

artf

@sakshigarg9 to prevent messes use the new addType (in your case you miss the view property and this breaks stuff in the old declaration) BTW I suggest to create a NEW component type by extending the image instead of just extending the cur...

#1867March 6, 2019by arthuralmeidap2 answers
0 reactions

[BUG] Custom compoent and JS

Hi @artf , I'm trying to create a custom component and attach a JS to it. To give you a better example, think this component as a Slideshow component. For this component, I have some custom traits to allow the user to change some pre-defined configurations. The problem is happening when I attach the Js through the scr...

artf

The problem is happening when I attach the Js through the script key while I'm adding the block. The isComponent method is not being called for my new custom component. Hi Arthur, can you provide some code example of your case because I ca...

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.

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

#1862March 6, 2019by sakshigarg93 answers
0 reactions

Reflect deleted components in block manager

How can I create dynamic components in block manager such that when a delete action is performed on a component it triggers the component to be placed in the block manager?

arthuralmeidap

Well, component and blocks are different concepts. If you are saying about blocks you can use the .trigger('remove') on the block that will remove it from the BlockManager

artf

@sakshigarg9 Read the documentation https://grapesjs.com/docsTry to understand what you're readingTry to solve your issues by yourselfIf you're not able to do it, then you can open an issue, by following its template, and SHOW US what you...

sakshigarg9

@artf thanks for all your patience, I'll do the same now onwards

#1859March 5, 2019by MisterFK3 answers
0 reactions

Change an element type in editor

Hi, In my javascript i already create 2 components (type "A" and type "B) with their own traits. I create a context menu on both elements to switch (in the editor) the selected element from type "A" to type "B" and change the traits in consequence. I didn't found the way to change the type of an element already insert...

arthuralmeidap

Take a look here: https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components It shows how to add/remove custom traits for existing types. It may help you

MisterFK

Thanks, but i don't want to change the type but i want to change the type of only one selected element... If i change the traits of component, all the others elements with this type will be changed and it's not the purpose.

artf

I didn't found the way to change the type of an element already insert in the editor. The solution will be the same in case you would like to change a <div> with an <img>... so you remove it and replace it with another component at the sam...

#1855March 4, 2019by ssabrewolf3 answers
9 reactions

Copy Paste Components

Hello Grapesjs Team Ive seen the regular copy paste works as long as is made in the same page, Is it possible implement a a copy paste between 2 different pages with the editor opened Thanks in advance

japo32

This is our implementation of using localStorage in case someone needs the solution. Clipboard API would have been a great cross browser solution but it's not yet widely used.

lexoyo

I didn't try it, I just read the code You don't trigger the paste event when pasting in the body Also the css is added in a style tag after each paste... There must be a better way to handle the styles, I'll take a look soon

artf

Is it possible implement a a copy paste between 2 different pages with the editor opened Well, if for 2 different pages you mean 2 different tabs, I don't think so. Obviously, you're dealing with different editor instances so you have to f...