GrapesJS Issues

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

644 issues found

๐Ÿ” components
#896February 23, 2018by maxtacco3 answers
4 reactions

[BUG] Media query rules are overridden by class rules in canvas

Hi @artf , I've noticed an issue while testing one of my templates using different device configurations that supposed to trigger media queries. My template has styles generated as following: It looks like this JSON is used to generate styles inside canvas as in this screenshot: You can see here that the '.cell' style...

vrudikov

@artf Created the PR

artf

Thanks for the catch guys and the great video @vrudikov, was really helpful. I'll investigate this

vrudikov

So now we have the following structure: And you want something like this:

#893February 23, 2018by alimajed933 answers
3 reactions

Add attribute to HTML

Hello everyone, I want to add an id for each block I drag and drop in the canvas; To be more clear, I do not want to add an Id for each type, per example: Image, Table, Box, ... I want to add ad Id for each block, which means per example, the block "1 section" becomes <table ... blockId = 1>. I am trying to use those...

nojacko

I think you need to add the attribute to the model, rather than the view. https://github.com/artf/grapesjs/blob/50cc585f23f2560077fd0e9a42ced22e67e69723/src/dom_components/model/Component.js#L298 Then, you'll need to render the view. I thi...

ezp127

Hello, Just leaving an example in case someone else needs.

artf

Just like James suggested but without selected.view.render() as the view will receive changes simultaneously

#871February 15, 2018by chthomos3 answers
0 reactions

[BUG] Wrong stylemanager options first time a component/block is selected

Hello, I have noticed the following buggy behaviour on the style manager:Using a local copy of GrapesJS (ver 0.14.5) . Tested in Chrome and Firefox both in Win10 and OSXGrapesJS is initialized and components are loaded through the loadComponents. (for example here's the JSON I used in the demo, where I load an image c...

artf

Hi @chthomos and thanks for the issue, but are you able to provide a live demo of this bug (eg. via jsfiddel)? I've just tried this on the public demo and it worked as expected

chthomos

Sorry for the late reply. I am working on a fiddle for this so you can replicate.

artf

@chthomos good, I close this then for now and reopen when the fiddle is available

#868February 14, 2018by nojacko3 answers
5 reactions

[BUG]: "component:add" event triggers when components are moved

Taken from https://github.com/artf/grapesjs/wiki/API-Editorcomponent:add - Triggered when a new component is added to the editor, the model is passed as an argument to the callback My understanding is that the component:add should only be called when the block is dragged in from the blocks panel and dropped into the e...

artf

@japo32 all available public events are documented here: https://grapesjs.com/docs/api/editor.html#available-events

seifelhoseiny

Any update on this issue? It still calls component:add event when I simply move a component around.

lv-alex

It works. Thank you @artf

#865February 14, 2018by byeonggukang3 answers
0 reactions

[QUESTION] How can I set default tagName

Hi ! I want to set tagName tr for all components(or specific component in use). Is there any predefined function to set tagName ?

artf

You can change the tagName of any component, at any moment, in this way: You can also change it at the component level, in this way any new one of its type will get it by definition. Read more about Components and how to extend them. Basic...

byeonggukang

works great! thanks @artf Is there any way to change wrapper's tagName also?

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.

#860February 12, 2018by vrudikov3 answers
0 reactions

Can't bootstrap GrapesJS + Material Design Lite integration

So i'm trying to bootstrap this integration and i think MDL framework doesn't run, because JS components are not initialized at all Here is the plunker I digged into the code of both GrapesJS and MDL and both seems work ok. I tried several ways of initializing MDL JS: canvas init, init script after GJS div content, bu...

artf

Hi @vrudikov JS seems to be loading correctly (and you can see that by other JS elements like dialog) but seems like MDL is not auto-initializing. I think you just have to find how to call its init method

vrudikov

For everyone who want to have Material + GrapesJS integration - just use material-components-web

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.

#846February 7, 2018by davidherlopgt3 answers
0 reactions

Error when I tried to add rows to a table

Hi guys I'm starting to use Grapesjs and I have a problem, I am trying to add 3 new commands to create tables, add rows and cells, the table works fine but when I add a row into the table I get this error: "Invalid target position: Target collection not found, Target is not droppable, accepts [undefined], Component no...

davidherlopgt

I forget put what version I am using grapesjs - 0.13.5 <link rel="stylesheet" href="Config/grapesjs-dev/dist/css/grapes.min.css"> <link rel="stylesheet" href="Config/grapesjs-preset-webpage-master/dist/grapesjs-preset-webpage.min.css"/> <s...

artf

@davidherlopgt Have you tried to use built-in table components instead of extending them? BTW create a live demo please

davidherlopgt

Hi artf thanks for your answer, I tried to use the table component and I can add the Table with one row and one cell in the header and the body, maybe the disadvantage is that if I change the color of the row to the header the body is chan...

#841February 6, 2018by kewilson3 answers
3 reactions

[QUESTION] Add default Trait (attribute) to model for all HTML Components (elements)

Hi, I've read the Traits, Components and API wikis, grepped all the open & closed issues. I've even found the code where you are creating the defaults (ID, Title, Alt) you have today. There have been similar questions asked but none answer the question at hand. For every HTML component I want to add another default at...

ryandeba

Hi @kewilson, You've got a few different approaches for how to accomplish this...if every single component needs this custom trait, then I would probably override the initialize method of the default component type and add it there. Someth...

kewilson

Hey @ryandeba thanks so much for the suggestions. I put in the second one and it works for, well, the defaults as you would expect. Blocks like link, image, input just to name a few it doesn't add the attribute but those must be classified...

josefph

@kewilson could you help me adding another default trait in a specific component?

#839February 5, 2018by JulyanoF3 answers
1 reactions

[QUESTION] Create custom selected component settings

There is a option in panel to change setting of component (For links, there is an option no change link - HREF - and target, for texts, id and title and for images, alt attribute). I would like to know how can I create that inputs and how can I change this attrs in selected component? I created a Panel's view to use a...

arthuralmeidap

@JulyanoF , Sorry, I missed the parenthesis. It is editor.TraitManager.getTraitsViewer().el

arthuralmeidap

Here is what you looking for: https://github.com/artf/grapesjs/wiki/Components

JulyanoF

@arthuralmeidap ok, but how can I show the component in my current Command?

#833February 4, 2018by rohanreddyg2 answers
0 reactions

[Bug]: on click of links with events Editor loading inside another editor

I am trying to load an existing Ad content into GrapesJS editor. On dragging new custom components into editor with some script, editor is loading inside the root editor frame. Not sure what is causing this issue.

artf

@rohanreddyg can you create a live demo of your case, please

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.