GrapesJS Issues

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

3464 issues found

#1894March 14, 2019by jwilson-lyonscg2 answers
0 reactions

[BUG] Custom Trait documentation example doesn't work

Specifically this: https://grapesjs.com/docs/modules/Traits.html#define-new-trait-type First of all, the keyUp event references onChange when the function name is actually onChange. Next, even if you fix this, this.model.get('value') evaluates to a blank/null value whenever I make changes to it. The only way I can see...

jwilson-lyonscg

Nevermind. I was misunderstanding the syntax. I didn't realize that the onChange and the onValueChange are 2 different unrelated methods apparently. It's not clear to me what onChange does exactly.

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.

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

#1891March 14, 2019by jwilson-lyonscg3 answers
0 reactions

Can't create new button component

I'm having a hard time creating a new component for a <button> element. What am I missing? Is something bugged out here? Works fine if I change it to an <input> element:

jwilson-lyonscg

Okay so after some more experimentation it appears my component structure is correct, but my button block was not working correctly. So the button block was like this: When dragging this block into the canvas, this did not get recognized a...

artf

I think the problem here is a misunderstanding of content key. When you declare a block The content is for the Component, like a string o like an object. The string version of the example above would be: But when you use content inside a C...

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.

#1889March 13, 2019by Nagavijay-kolla2 answers
0 reactions

How to append a child component at required position/index

For example, I have a parent component and this parent component has 4 child components. Here with trait functionality, I want to move the 3rd child component to 1st position likewise. I am able to move a component from any position to last by removing it from the existing position using component.remove() and adding...

artf

Use at, as an index, in options, eg. component.append(comp, { at: 0 }) will place the comp as a first element

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.

#1887March 13, 2019by sakshigarg93 answers
0 reactions

Get JSON of specific gjs-data-type

I want to export JSON of only a specific gjs-data-type="img" I'm trying this but it doesn't give any result:

prashant2018

Could you please include the file name which contains this code snippet ? If I am not wrong it is in panels/index.js

sakshigarg9

Yes

sakshigarg9

thanks @prashant2018 using editor.DomComponents.componentById.image I was able to get the desired JSON

#1886March 13, 2019by sdrebel2 answers
0 reactions

How to create Drop down for the button inside a panel?

I'm trying to create a dropdown while clicking a button. I can append the data using ul, li to a button. Other than that any other way is there? Ex: When I click a file button, respective operations should be displayed like Open, Close etc.

artf

Follow the issue template and explain better your context (are you talking about components? editor UI??)

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.

#1885March 12, 2019by ghost3 answers
1 reactions

change storage manager request method to PATCH

Hey @artf does the storage manager support changing the request method from post to patch? I did not see that anywehre in the docs.

tranle13

Hi @artf ! I just started using GrapesJS (awesome plug-in btw, thank you so much!) and I'm wondering whether this has been added or not?

rukavina

:+1: As per source code it's not supported but it should for sure. Semantically POST creates resources, while storage is actually updating it. So PUT or PATCH are more valid IMHO. Anyway, the best is to provide ability to let you decide wh...

artf

Anyway, the best is to provide ability to let you decide which method should be used while sending "update" requests. I agree... Probably I'll add this option (storageManager module) in the next release: So, in this case, you'll be able to...