GrapesJS Issues

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

877 issues found

πŸ” question
#3275Feb 18, 2021by confettidc2 answers
2 reactions

Limit the number of times of block to be dropped

Hi, Is it possible to limit the number of times of block to be dropped? e.g. the form block and be dropped once only. Thanks.

theSC0RP

Hi @confettidc, you can try doing something like, have a counter variable and update it once a block of a type is added and remove the newly added block if the counter condition is satisfied. Do check the API Reference.

GJSBlock

Thanks for reporting this, @confettidc. Great question about Limit the number of times of block to be dropped. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your spe...

#3273Feb 17, 2021by ThomasPof2 answers
0 reactions

REQUEST : Need a new release to have cleanId function

The grapesjs-mjml extension needs a newer version of grapes.js This commit is cleaning ids and grapesjs-mjml need it in order to produce valid MJML code. Can you provide a new release ? (the master version is 0.16.37 and the release is still 0.16.34) Thanks a lot ! :-)

artf

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

GJSBlock

Thanks for reporting this, @ThomasPof. Great question about REQUEST : Need a new release to have cleanId function. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

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

#3271Feb 16, 2021by Francos102 answers
0 reactions

SFTP

Hi, I have a question can the photos and videos we add in grapesjs be stored on a server using sftp?

artf

You can read more about how to handle asset upload here: https://grapesjs.com/docs/modules/Assets.html#uploading-assets

GJSBlock

Thanks for reporting this, @Francos10. Great question about SFTP. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener...

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

#3267Feb 11, 2021by mosh-tudor4 answers
1 reactions

Cannot set 0px box shadow blur

For some reason, the editor does not allow to set the blur to 0px. 0 always magically turns into 5px. <img width="243" alt="Screenshot 2021-02-11 at 17 14 05" src="https://user-images.githubusercontent.com/668451/107664461-ba321e00-6c8c-11eb-91ce-4e8a87a2e33c.png"> Are you able to reproduce the bug from the demo? Yes...

artf

This one should already be fixed

artf

Thanks, I guess there is some falsy check with the 0 which leads to the default 5px value.

akankshach29

Would like to help fix this bug. Will raise a PR.

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

Browse all topics