GrapesJS Issues

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

545 issues found

πŸ” typescript
#3331Mar 10, 2021by Abhisheknanda13444634 answers
2 reactions

Custom Asset Manager

Hi @artf I followed the documentation to make new type of asset manager here ( https://codepen.io/abhi_punk81/pen/MWbWzaq) I've created new type like the same one in the docs How can i open that asset manager after dropping my custom block of icon -: At first it'll work fine but when i drop the image block after that...

Abhisheknanda1344463

@artf Achieved it and handle case-insensitive also https://user-images.githubusercontent.com/20657737/112457190-82d18980-8d81-11eb-895b-b5c42e849f3a.mov Thank you!! ❀️

Abhisheknanda1344463

Hi @artf somehow I've managed to do it On component active I called this -: It'll open my asset manager and I've added assets for this custom manager as well as you can see in the screenshot <img width="1105" alt="Screenshot 2021-03-20 at...

artf

Should be similar to what you've already done here editor.AssetManager.render(editor.AssetManager.getAll().filter(asset => asset.get('type') == 'svg-icon')); So find assets by search and update it with render

#3329Mar 10, 2021by imouou4 answers
0 reactions

How should I receive custom trait modifications in the script?

Hi, @artf, this is a great framework, thank you very much. I am now using it to create components of the mobile BUI framework, and I ran into a problem, I added a custom trait textarea, how can I make this When the data changes, it is triggered in the output script.

Ju99ernaut

You'll need to add the trait to script-props, you can read more here https://grapesjs.com/docs/modules/Components-js.html#passing-properties-to-scripts

imouou

Thanks @Ju99ernaut, If it is some built-in features, when modifying the script can receive the value of the parameter, I am currently experiencing problems: custom feature textarea, can trigger changes such as dom, but the exported script...

Ju99ernaut

You can try forcing the script to update:

#3328Mar 9, 2021by D-Rosa994 answers
2 reactions

How can I update the nodeValue (text value) of components by inputs forms

Hello. Grapesjs is a great tool. Thanks for it. I want to update the text value of a component by inputs, how can I do that?? if a user filled the input box with something like: TEA SITE, the title should change to it

artf

Just find the component and update it as you wish

millord

I'm also want something similar with my grapes app, but using react to update a text component via a control input. Somebody can help with that?

D-Rosa99

it works, thanks

#3325Mar 9, 2021by mmotov4 answers
0 reactions

JSON.stringify(this.editor.getComponents()) Error

Version: 0.16.44 Hi there! I have remote storage for pages, and recently I faced an issue when saving page, JSON.stringify(editor.getComponents()) started to throw error Uncaught TypeError: e[M].getId is not a function. I investigated the already saved JSON representation of the page and found out that it fails on thi...

yucomds

Same error here ... do you have a solution? [EDIT] Downgrading seems to be the only solution for now

josfh2005

Same problem here, if I preprocess the components and remove that attribute (__symbol) before load the Editor the template works fine. Is the a way @artf to disable the symbols for now?

artf

Yeah unfortunately the previous version of grapesjs had a bug that created symbols involuntary. In the current version, the bug is fixed and symbols are disabled, but unfortunately, this still happens if you try to load a component with a...

#3322Mar 7, 2021by Andrew-Chen-Wang1 answer
0 reactions

How to update built-in component's traits?

nvm You have to put component overriding in the plugins.

GJSBlock

Thanks for reporting this, @Andrew-Chen-Wang. Great question about How to update built-in component's traits?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your s...

#3319Mar 5, 2021by anatoli-dp3 answers
0 reactions

Layers text does not center after creating a new line

Version: current? You can get the version by typing grapesjs.version into the console Are you able to reproduce the bug from the demo? [ ] Yes [ x] No // to be fair never tried in the demo What is the expected behavior? when editing the layers text and adding a new line then backspacing i would expect the edited text...

artf

Ok, I'll push a fix for the editing of layers name, probably it doesn't make sense having new lines enabled there (I'll make stop the editing on Enter/Esc). For the second issue, If you're using something yours to resize the canvas, probab...

anatoli-dp

yeah I didn't realize editor.refresh() was a thing until after. otherwise thanks. awesome project

GJSBlock

Thanks for reporting this, @anatoli-dp. Great question about layers text does not center after creating a new line. The recommended approach with Canvas is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

#3316Mar 5, 2021by am1rb4 answers
1 reactions

The editor does not remove the dead script blocks

Version: 0.16.34 Are you able to reproduce the bug from the demo? [ ] Yes [x ] No As I understand the code import dialog skips all the HTML scripts, so I can not reproduce the issue on the demo What is the expected behavior? The editor must remove dead script blocks before appending a new script block at the end of th...

Ju99ernaut

I'm unable to reproduce this, maybe you can provide more information on the custom component itself, anyway I suspect this is a storage related issue. Are you storing then loading pages from the generated html?

Andrew-Chen-Wang

Typically inline scripts go in the body at the bottom. Try putting it there maybe?

am1rb

I do not append anything by myself. The editor appends the scripts related to my components in a new script tag at the end of the generated HTML. Please take a look at this file: https://github.com/artf/grapesjs/blob/dev/src/editor/model/E...

#3315Mar 5, 2021by devtechk4 answers
3 reactions

Mm or cm Units are converted to px

I realized that mm or cm units are converted to px. How can i solve this problem? Thank you

Ju99ernaut

Did you add mm, cm etc, as units to the style manager inputs, these are not built in

Ju99ernaut

As stated above it's what the browser engine does, usually this is the fix, but I've never used it with units that aren't built in:

Andrew-Chen-Wang

I think that's just what the browser engine does in general. I'm no expert, but I think that output is just the final info interpreted by the engine.

#3313Mar 5, 2021by fahad1574 answers
2 reactions

There are lots of click required to make text editable, can we make text field editable on a single Click.

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

Andrew-Chen-Wang

Single click can get annoying when dragging around blocks. If you've already selected a block, you still need to do a double click. If you didn't select a block, then you can just double click the block to edit the text. I think that's pre...

fahad157

@Andrew-Chen-Wang Yes that's right but in my scenario i want edit on just single click, if it is possible then plz guide.

mihir-khandekar

@fahad157 were you able to fix this?

#3309Mar 4, 2021by jcamejo4 answers
0 reactions

TextNodes interfere when changing content on element

Version: 0.16.44 Hi @artf I have a custom block with a custom button component, which its content is similar to this one. <a data-gjs-type="custom_button" class="btn btn-1" href="">Click here</a> Additionally, I've added a text trait to change the button content, in this particular case I do not want to use the editor...

artf

Hi Juan, thanks for the report, are you able to show me how your text trait works? I'd expect it to work correctly if you update your component in this way component.components(e.target.value)

jcamejo

This was my trait I have changed it to And now it works without overriding update content or render children, thanks! I would have never arrived to the conclusion of using the components method. Now i don't like text nodes πŸ˜… I think we ca...

artf

I don't think you need this one target.set('content', value);. For the rest all good πŸ‘

Browse all topics