GrapesJS Issues

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

569 issues found

๐Ÿ” canvas
#2184August 6, 2019by D33Funky3 answers
0 reactions

[QUESTION] Losing predefined media queries

Hi. I have a predefined json of a template which contains a set of html elements and styles which are parsed into the set of components upon grapesjs load. The css contains some of the default media query rules which I'd like to keep for the template. Commands editor.getHTML() and editor.getCSS() return correct values...

artf

Provide a reproducible demo, please

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

abozhinov

I have the same problem. This is my issue -> https://github.com/artf/grapesjs/issues/2843

#2181August 4, 2019by pouyamiralayi3 answers
2 reactions

global functions/variables

Hello there! recently i noticed this issue. I think it would be beneficial to have this feature. in contrast to the suggested approach by @artf that uses canvas scripts as a way to inject globally, i think this is not functional for the main purpose that this feature is intended for. in my opinion the main use case fo...

artf

Sorry @pouyamiralayi but I believe you didn't get the total meaning of script property in Component (obviously you're not the only one, even if I try to explain this "script paradox" here) What is asked in #1691 it just DOESN'T MAKE SENSE...

pouyamiralayi

thanks for your kind answer @artf . after struggling with the idea i am reaching to the point that what you are saying is totally reasonable. that was very naive of me to bringing this matter up again sorry for that. the current workaround...

collindutter

@pouyamiralayi would you mind providing some more information on how you created a global event bus to send messages between global scripts and local ones? The editor embeds the grapesjs content in an iframe, so you can't use a global wind...

#2179August 2, 2019by afdallah2 answers
3 reactions

[QUESTION] Auto wrap every component drag into canvas with another component

I am trying to make sure every component drag into the canvas to be wrapped with a column component. To achieve that I use canvas event. First I disabled window event to prevent default html 5 drag and drop event to be fired. canvas:drop event Let's say that my column component is so simple, only a single div. canvas:...

afdallah

@pouyamiralayi I managed to solve the problem by making component as an object. Like so. Anyway thanks for trying to help.

pouyamiralayi

Hello there! the event you are looking for is this editor.on('block:drag:stop', function (element) { element.replaceWith({ tagName:'div', style:{'border': '1px solid red'}, components: [element] }) }) Notice here I am using a red bordered...

#2175July 31, 2019by yanosuke2 answers
0 reactions

[Feature Request]: Canvas Touch Support iOS

My customers also require the ability to use the GrapesJS platform on their mobiles, therefore I am currently using the GrapesJS-Touch plugin. The issue, however, is not with the plugin, but rather about a missing method within the GrapesJS code. The issue and solution are provided by Mikereem at the following link: [...

artf

I'd be happy to merge a PR

saltyfoam

We're making use of GrapesJS and would love to have greater support on mobile so I hope this goes through!

#2172July 28, 2019by danrcoull3 answers
2 reactions

QUESTION: is there a way to do trait based placeholders

Hi Not sure if this is the correct place to ask. trying to load the content of a textarea into this framework. But allot of the links have placeholders within the default html such a <a href="{{placeholder for default url }}" is there a way to render this link within the canvas but leave the original html unmodified?

zgover

Your question isn't completely clear are what you're trying to achieve, but take a look at creating components.

pouyamiralayi

hi! for the select model you may use editor.Modal and as it's content, inject your desired logic for choosing and configuring your widgets. then you can inject the result widget using yourComponent.components(yourWidget) to fill the conten...

danrcoull

Sorry Let me explain take a cms widget such as {{widget name="test" type="\Php\Class"}} Concenpt is to drag a block which opens a widget select model to choose a widget set the options and hit add that generates such as above. This needs t...

#2150July 18, 2019by vish43951 answer
0 reactions

Integrate FullPage.js with grapesjs

Hello @artf , I want to add Fullpage.js with GrapesJS. So please help what should I do? I trying by it loading as simple HTML content and add fulpage.js in canvas scripts. but I can't do it.

artf

Start by reading the documentation: https://grapesjs.com/docs/modules/Components.html https://grapesjs.com/docs/modules/Components-js.html If you're not yet able to do it after docs, open an issue by showing the code which is not working

#2136July 12, 2019by selcukcura3 answers
2 reactions

[QUESTION] custom component type not found and traits not working after page load

Hi @artf I have created a very basic custom component named 'customsection' which uses traits to change the component's background-color by adding a class. Pretty straightforward. I have created two blocks:Section - includes only the component.Section collection - includes a collection of DOM elements and the componen...

artf

Try to put your custom component definitions in a plugin and see if it works

alialrabi

@selcukcura are it is working when putting it in plugin ?

selcukcura

Much appreciated @artf, placing my custom component in a plugin solved both issues! Out of curiousity, are there any particular reasons why it now works as a plugin and not otherwise ? @alialrabi Yes, I managed to get it working. Try using...

#2127July 10, 2019by zyxnowell1 answer
0 reactions

[QUESTION] How to update content prop from trait event

Hello, I want to update the content property based on the changes from the trait I have this component added and notice I have a custom property chartType which is the one that I would be needing to update. Here is the Trait that I created: What I want to do is whenever the updated or doStuff event is called in the ca...

artf

First of all, move all the props from block to the component to have something like this: otherwise, you can face unexpected behaviorsWhat I want to do is whenever the updated or doStuff event is called in the canvas-options it will update...

#2125July 9, 2019by zyxnowellNo answers
0 reactions

[QUESTION] How to have a dynamic properties in a custom block?

Hello, I am making a custom category using ChartJS which would be blocks of draggable charts. I currently have this code to have a static chart rendered in the canvas after dropping Now my problem is after dragging it I cannot update/edit the chart's data. How can I make it so that the data, options properties of the...

#2124July 9, 2019by edward18931 answer
0 reactions

[QUESTIONS] get html component video

Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't existis it possible if I want to add 1 div as a parent again? (for stye css)

artf

Why on the editor canvas, the video component has a div in parent tag (video), whereas when I get html(editor.getHtml()), the div doesn't exist To make a component behave in a specific manner its view (what you see in canvas) can be comple...