GrapesJS Issues

3,464 parsed GitHub issues β€” 370 solved Β· 90 open. Search, filter and explore battle-tested answers.

545 issues found

πŸ” typescript
#3277Feb 18, 2021by FrancoFasano2 answers
1 reactions

Default PDF size: US letter How to set A4?

WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueJSFiddle Starter template https://jsfiddle.net/szLp8h4nCodeSandbox Starter template https://codesandbox.io/s/1r0w2pk1vl *Version:0.16.3 You can get the version by typing grapesjs.version into the console Are you able to reproduce the bug fr...

artf

Hi Franco, you can define the frame size by changing devices

GJSBlock

Thanks for reporting this, @FrancoFasano. The issue with Default PDF size: US letter How to set A4? appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modificat...

#3276Feb 18, 2021by ThomasPof2 answers
0 reactions

CleanId function not working with MJML code

This issue is about MJML code but I think this is more about grapesjs than grapesjs-mjml There is a function that remove unnecessary IDs in src/code_manager/model/HtmlGenerator.js. This function is working well on HTML tags, but not on MJML tags. What I found is

artf

https://github.com/artf/grapesjs/releases/tag/v0.16.41

GJSBlock

Thanks for reporting this, @ThomasPof. Thanks for sharing your report about CleanId function not working with MJML code. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle...

#3272Feb 17, 2021by ThomasPof4 answers
0 reactions

Id are added to <img/> on double click on it

Version: 0.16.37 Are you able to reproduce the bug from the demo? [X] Yes [ ] No What is the expected behavior? It's about the GrapesJS-mjml plugin : this syntax doesn't accept id's on elements. But AssetsManager add ids to image elements. I would like to not add id attributes to <img> tags Steps to reproduceclone and...

ThomasPof

The id seems to be added way before opening the asset manager :clone and run the projectadd an image on the index.html fileinspect this image element : there is the id in the dom element

ThomasPof

Found a clue in /Users/thomaspopoff/Sites/grapesjs/src/code_manager/model/HtmlGenerator.js line 10, the opts.cleanId is always undefined. I don't know how to set it to true to remove auto-generated ids

ThomasPof

Ok sorry for all my self-talk : there is an option opts.cleanId inside getHtml() function you can configure to remove auto-generated ids...

#3270Feb 15, 2021by haizenbergD2 answers
0 reactions

How to export JS code from angular components?

Hey, I am using grapesjs in my Angular app I have a custom angular component (which is basically custom HTML created with angular) and I am trying to export content using grapesjs-plugin-export Issue I am facing is that after export there is no JS code (which is initially inside angular component) that can do with htm...

artf

You can more about components with js here: https://grapesjs.com/docs/modules/Components-js.html#basic-scripts

GJSBlock

Thanks for reporting this, @haizenbergD. Great question about How to export JS code from angular components?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your sp...

#3269Feb 12, 2021by acondura4 answers
0 reactions

Translating html string

Great library! It meets all the requirements but one: website text translation. I've searched high and low through the issue queue and docs and for some reason I can't find anything about this subject. My clients do not care that the grapesjs editor is in English. What they want is the ability to easily translate thei...

artf

This is something you would need to create on your own. Maybe a custom text component, which gives the possibility to change the content with the selected language.

jordandevogelaere

@acondura do you have a solution for this? I have the same requirement for my client. Thanks

gxanshu

i have the same requirement too. and yes only way we can achive this is by creating our own component

#3268Feb 12, 2021by theSC0RP4 answers
0 reactions

How to add javascript in the html without sanitization?

Hey @artf, I am taking javascript input from the user. I need to add this javascript inside the template HTML but it gets sanitized. Is there a way that I can turn off the sanitization? (I don't have an issue with the problems you mentioned in #3245 ) or can you add a property in the editor like allowSanitization: fal...

theSC0RP

I tried adding the script to the iframe in which the canvas renders by adding a <script> tag at the end of the body of the iframe. This works to some extent. The problem here is that when I need to update the js inside the script I will ne...

artf

Can you provide a reproducible demo of your issue, please?

theSC0RP

Thanks for the reply @artf. I was doing a mistake while updating the iframe so now my problem is solved! Just another question, is there any built-in method to refresh the iframe?

#3266Feb 9, 2021by amliu2 answers
0 reactions

How to know from which block is the selected component generated ?

Wondering how to do a reverse lookup, from component back to block. I use Block Manager add() to add a block like below after initialization. How do I if the selected component is generated by this custom block ?

artf

You should think more about components than blocks, indeed the right Block should look more like that. But in case you need it, you can always attach custom properties to your content block (which then will be appended to the component) On...

GJSBlock

Thanks for reporting this, @amliu. Great question about [Question] How to know from which block is the selected component generated ?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS...

#3265Feb 5, 2021by jcamejo3 answers
0 reactions

RenderField in traitView does not handle null or undefined

Hi @artf! Working on the editor on one of my custom traits i had an issue where for some reason that is not important, the createInput was returning undefined. I've noticed that the TraitView renderField method does not handle falsey values It when directly to try to append an undefined object, raising an error. Shoul...

artf

Hi Juan, thanks for the report, yeah actually createInput requires you to return an HTML string or HTMLElement. I think it's good to have errors in cases like that but I guess the error wasn't clear enough. Honestly, I don't know what is t...

WebDevXpert

Hello @artf! Hope you are well. I am having an issue using grapesjs plugin publish s3.. How can i use that plugin and publish my data??

GJSBlock

Thanks for reporting this, @jcamejo. The issue with RenderField in traitView does not handle null or undefined appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DO...

#3262Feb 4, 2021by lacieri2 answers
0 reactions

Parse styles to a Css string

Hi @artf ! Is there any way to parse the styles into a CSS string? This would be helpful in a scenario where you have multiple GrapesJs instances stored and you want to update the CSS on all of them. You can manipulate the styles because that is an array and it's reliable. Currently, on the CSS I am using regex to loc...

artf

Well, you should be able to take the CSS from any GrapesJS instance with editorInstance.getCss(). Which basically generates the CSS from the styles JSON

GJSBlock

Thanks for reporting this, @lacieri. Great question about [QUESTION]: Parse styles to a Css string. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific m...

#3261Feb 4, 2021by nithinpillalamarri1231 answer
0 reactions

How to customise the grapes js form to append style

WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdDo a quick SEARCH first, to see if someone else didn't open the same issueAll relative statements/questions have to be filled/answered, otherwise, th...

GJSBlock

Thanks for reporting this, @nithinpillalamarri123. The issue with how to customise the grapes js form to append style appears to be a race condition or state management timing problem. This typically happens when component lifecycle events...

Browse all topics