GrapesJS Issues

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

877 issues found

πŸ” question
#3380Apr 2, 2021by alemenciones2 answers
0 reactions

Default properties not selected in styleManager

Hello dear, can you know why default properties is not selected in style manager ?? What event can I trigger to update this ??

artf

Try to check your configuration for the styleManager https://github.com/artf/grapesjs/blob/dev/src/style_manager/config/config.js (highlightChanged should be true)

GJSBlock

Thanks for reporting this, @alemenciones. Great question about Default properties not selected in styleManager. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for you...

#3378Apr 1, 2021by dluague2 answers
0 reactions

Null text after saving.

Version: 0.16.45 Are you able to reproduce the bug from the demo?[ ] Yes[x] No What is the expected behavior? There shouldn't have null text. What is the current behavior? After saving the data to the database and retrieving it (see attached components object) the null will appear. This is how I assign the components...

artf

Seems to be an issue on your side as I can't reproduce it (maybe you're doing something wrong on your back-end?!). Try to create a reproducible demo first (by using the localStorage)

GJSBlock

Thanks for reporting this, @dluague. The issue with null text after saving. appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating a...

#3376Apr 1, 2021by rcloss4 answers
3 reactions

Changing upload URL for AssetManager programmatically

I've got an situation where depending on how the Asset Manager is opened I want to pass a slightly different upload URL. In the asset:upload:start event I have it looking to see which upload URL it should use, and if I have to change it I'm doing the amConfig = editorAssetManager.getConfig() amConfig.upload = 'NEW URL...

SzaboGabesz

editor.AssetManager.config.upload = 'NEW_URL' will do it

Ju99ernaut

The value in config is only used during init so changing it does nothing, maybe changing these might help:

rcloss

Thanks, just tried both of those, but no luck, at least in the asset:upload:start event

#3375Mar 31, 2021by christosapos2 answers
0 reactions

Cannot add spaces to extended button component based on text component.

Hello guys, First of all i would like to express my gratitudes for this amazing tool. I have extended button component based on text component so as to can edit the content of button manually without using traits. The code for the extended button component is this: var comps = editor.DomComponents; var defaultType4 =...

artf

Seems like space triggers the click event in Chrome. The solution seems to be to add the preventDefault on keypress https://stackoverflow.com/questions/22104860/chrome-firing-onclick-when-space-typed-in-contenteditable-button ps. avoid ext...

GJSBlock

Thanks for reporting this, @christosapos. Great question about Cannot add spaces to extended button component based on text component.. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS...

#3373Mar 31, 2021by ikenderham2 answers
0 reactions

Predefined background colors when selecting a element with a certain class or div.

I have a question i hope sombody can help with. I want to make a trait where i can chose predefined colors, when selecting a div with a certain div. Can anyone help me, how to achive that in a simple way?

artf

Well, you can use a simple select trait type with the list of colors and update its style once is changed. Here you can find all the examples necessary for your case: https://grapesjs.com/docs/modules/Traits.html

GJSBlock

Thanks for reporting this, @ikenderham. Great question about Question: Predefined background colors when selecting a element with a certain class or div.. The recommended approach with GrapesJS is to use the event-driven API. Start here: C...

#3371Mar 29, 2021by devtechk2 answers
2 reactions

Generate pages numbers any idea?

Hi, guys I'm creating a doc generator through grapesjs, I'd like to insert page numbers like "Page 1 of 5" at the bottom of each page. My starting template have a wrapping class called .page actually I'm able to clone one page under one other to get more pages. Do you have any idea, how can i implement this feature ?...

devtechk

Hi Guys! I've found a way to achieve my goal! CSS property! here's my working code (you can call pagination tag as you want). Source: https://www.pagedmedia.org/paged-js/ HTML: <pagination class="text-right paginating">Pag </pagination> CSS

GJSBlock

Thanks for reporting this, @devtechk. Great suggestion about Generate pages numbers any idea?! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior. Using the event system: Alternative a...

#3370Mar 29, 2021by xinnai1 answer
0 reactions

Compressed getJs issue

@artf Hi, I'm not sure if you understand my question. I want to edit the js code in my own js editor, first I set the js code from your editor using getJs(), but it looks like this in your demo.html: These code are all compressed. I want an uncompressed code like this in https://github.com/Ju99ernaut/grapesjs-script-e...

GJSBlock

Thanks for reporting this, @xinnai. Great question about Compressed getJs issue. 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()...

#3369Mar 28, 2021by jcsofts3 answers
0 reactions

Is it possible add a relative offset for the colorpicker

for example: I add a left bar and top bar outside the editor. I know the colorpicker's position is relative the body, so is it possible add a relateoffset to the config. so I can add a -40 to mek the colorpicker to right position?

artf

You should be able to define color picker options in this way here you can check all the available options

skru

Is it possible to access the colorPicker after .init()? I'd like to dynamically update the pallete

GJSBlock

Thanks for reporting this, @jcsofts. Great question about FEAT: is it possible add a relative offset for the colorpicker. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation f...

#3368Mar 27, 2021by sizhousama2 answers
0 reactions

I need to reload "https://.../main.js" every time I add a block,what should I do?

I need to reload "https://.../main.js" every time I add a block,what should I do?

artf

Subscribe to the event you think might be useful for you and then reload as you wish

GJSBlock

Thanks for reporting this, @sizhousama. Great question about [QUESTION] I need to reload "https://.../main.js" every time I add a block,what should I do?. The recommended approach with GrapesJS is to use the event-driven API. Start here: C...

#3367Mar 26, 2021by kerryj894 answers
1 reactions

Modal template

Is there a way for me to modify the template from a compiled state? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0bd070c0b/src/modal_dialog/view/ModalView.js#L1-L16 If not, what would be the cleanest way to insert title and content into a modal skeleton from our CMS for a tighter look and feel?...

artf

Now it's possible to replace the modal https://grapesjs.com/docs/modules/Modal.html#custom-modal

Ju99ernaut

Here's a list of plugins that use the built in modals, hopefully they're helpful: https://github.com/artf/grapesjs-tui-image-editor https://github.com/artf/grapesjs-custom-code https://github.com/Ju99ernaut/grapesjs-template-manager https:...

kerryj89

Thanks, but I was looking for a way to inject the content into my own modal. A lot of libraries have a modal template file or variable to do this.

Browse all topics