GrapesJS Issues

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

3464 issues found

#2493January 7, 2020by andrewryan19062 answers
0 reactions

Invalid array length when dragging component onto canvas

Not sure why, But all of a sudden, when I start dragging components onto a canvas, I get this: This seems to happen when I edit a template, save it, and reload it. It also seems to happen when I try to drag a new component to the LAST element of the page; if I try to drag and element inside of a DIV container inside t...

andrewryan1906

Here's another clue... once the canvas "breaks" (which I can reliable make happen by refreshing the page and forcing a load... this behavior doesn't happen on new templates, only when the template is loaded from my custom storage, but I ve...

andrewryan1906

OK, I managed to stick grapes.js into my Angular project and reference it instead of the minified version, so I could get more insight into what is going on. The problem seems to be in Sorter.js. The findPosition method is tasked with figu...

#2491January 6, 2020by sukheja-varun1 answer
1 reactions

Issue attaching event to new plugin in Anglar

Hi all, I was trying to add a new plugin to grapejs within my Angular project. Requirement: New plugin with name as Product. When the user drops the Product Plugin in HTML, it should open a modal where the user can type some attributes and an auto-complete search where the user can search multiple products and submit...

pouyamiralayi

@sukheja-varun attach any event to the new plugin inside your plugin, you must first define a custom type component: then define a new block which is using our previously defined custom component type: for the modal, we define the below fu...

#2490January 6, 2020by eD5722 answers
1 reactions

[bug]: Style Manager has a giant + sign

Hi art, there seems to be a problem with the Classes attribute in style manager, a Giant plus sign keeps displaying itself, whether I use it locally from my copy or on your demo. Version: Latest as of this date Browser: Mozilla OS: Ubuntu 18.04 Bug: Giant + on style manager Hey art just an update, think it's a mozilla...

artf

Ok thanks for the report, I'll adjust them in the next release, for now, you can this CSS as a temporary fix:

senchden

Can confirm on Firefox 72 and MS Edge 44.18362.449.0 . Tested with web page demo version 0.15.10. Several view icons have incorrect size:

#2488January 3, 2020by logeshkrishna03 answers
0 reactions

How to restict the adding of css property for the gjs-hovered class

WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...

logeshkrishna0

logeshkrishna0

logeshkrishna0

@artf could you please help me out

#2487January 2, 2020by msantore3 answers
5 reactions

[BUG] Updating a trait resets the component styles

I'm having an issue with Traits, wondering if this may be a bug. When I update the fontColor or fontSize trait, the other traits reset. Video: https://www.loom.com/share/6a40830699ad4c4590363f2641a07eac Code: https://github.com/msantore/vue-builder/blob/master/src/plugins/materials/components/index.js#L362 GrapesJS Ve...

pouyamiralayi

@msantore you are using `setStyle` which will override the previous styles. use it like below: cheers!

msantore

That fixed it, thanks!

artf

You can also use addStyle({ color: ${value} }) which does the same thing

#2486January 2, 2020by andrewryan19061 answer
12 reactions

How do I add a trait to all existing component types?

I want to go through all existing component types and add a trait to the model-> defaults and can't figure out how to do this. According to the documentation, I should be able to (in my plugin): But this overrides the traits array, which removes the existing traits, which isn't what I want. My next step was to try to...

pouyamiralayi

@andrewryan1906 for pulling the default traits: so your traits definition would be like below: cheers!

#2484January 1, 2020by electrotype2 answers
0 reactions

Custom Store/Load using a Json object, without using the "Storage" API

I'm using the latest version, 0.15.9, and I'm new to this fantastic project! I'm currently learning a lot, starting from scratch. Please let me know if you prefere such questions on Stack Overflow or elsewhere. I'm trying to export/import the content by myself, without using the "Storage" API. I see the store() functi...

electrotype

I think I got it using: Then: let export = editor.store(); And: importFrom(export); That said, it doesn't feel totaly "right" to me. I would like a version of the functions where you can specify the exported Json object directly!

artf

Using custom storage is actually the best wayI would like a version of the functions where you can specify the exported Json object directly! Well, no one limits you to update your exportToLoad

#2483December 31, 2019by andrewryan19062 answers
1 reactions

Default model names not persisting to local storage

When I create a new Dom Component, I give it a name in the "defaults" section, like: When the component is dragged on to the canvas, the Foo Bar string shows up as a badge like it should, and the text appears in the Layers panel and everything is good. But when the canvas is persisted to storage, and I refresh the pag...

pouyamiralayi

@andrewryan1906 please define your component type inside a plugin. cheers!

andrewryan1906

That works, thanks!

#2482December 31, 2019by andrewryan19063 answers
0 reactions

How do I change the name of the default component?

I noticed everywhere in the canvas "Box" is the term for the default container. I'd like to change that I found the customLabel strategy function on the canvas; that works, but as soon as I implement it, I lose the default behavior for labelling everywhere else in the template designer. Don't want that. Really, what I...

artf

You can do it by updating the i18n string

andrewryan1906

Outstanding! Thanks.

andrewryan1906

Hey... this works, but nulls out all of the other names. How do I override just that name?

#2481December 30, 2019by andrewryan19061 answer
1 reactions

Unable to use Font Awesome Icons inside of the Canvas

First off, great work on an amazing project. Can't believe this exists. OK, I've spent the last few days going through the docs and now am starting to build my own components. However; for template design, I want my components to render differently. I can see that I can intercept the rendering and change that. But I'm...

andrewryan1906

I actually discovered the problem halfway through writing the post but decided to finish it and leave it here in case anyone ran into this. The styles used for panels, blocks, etc don't apply to the styles inside of the canvas, since the c...