GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#3569June 26, 2021by sktlmaratNo answers
0 reactions

Remove the wrapper when the child component is deleted

Hi! I created a DOM component and I was thinking whether it is possible to delete the div wrapper when I delete the child text component. I tried to do it with the removed hook but couldn't came up with the correct solution. Thanks!

#3565June 24, 2021by Ubanna1 answer
0 reactions

undefined for multiple page manager in React

Hi, please what is the best way to implement multiple page manager in a react app. I have successfully implemented this without page manager like so: For the page manager implementation I try this: Here, I get undefined for page manager. I would appreciate any help please. Thanks

artf

I think you're just using an old version of GrapesJS

#3564June 24, 2021by theSC0RP3 answers
0 reactions

BUG: Unable to refresh the iframe

0.17.19 Are you able to reproduce the bug from the demo? YES What is the expected behavior? I had asked a question regarding iframe refresh (#3413). The proposed solution was working for that version (0.17.3) and after running the piece of code the iframe should refresh and the canvas should be seen with the component...

artf

I would need to check why he is still trying to remove the frame, but for now, just skip this line frameView.remove()

theSC0RP

@artf. Thanks. This works when done once. If I do some action like a click inside the canvas and then if I run frameWrapView.render(); once again, I got another error. The screenshot and a video of this error are attached below. <hr> https...

artf

I'll try to fix it in the next release, but for now, you have to unselect components before frameWrapView.render() and reselect them back post rendering

#3562June 23, 2021by MarksEliel1 answer
0 reactions

How to edit data attributes

Is there a possibility to edit data attributes on components?

artf

Yes, please check the documentation and follow issue templates

#3561June 23, 2021by AStoker3 answers
0 reactions

FEAT: Enhanced Shadow DOM Support

What are you trying to add to GrapesJS? Better Shadow DOM support, allowing developers to render GrapesJS inside a Shadow element without having to specifically pass in elements rather than selectors in the configuration. Describe your feature request detailed When currently using element selectors, GrapesJS simply us...

artf

Hi @AStoker I don't understand what is the real issue with your example (aside not loading GrapesJS styles inside your shadow dom). If you're attaching shadow dom, obviously, you can't do this container: '#gjs', but you're still able to pa...

AStoker

The issue is that I must pass HTML elements everywhere and cannot use selectors. This can become cumbersome to write as I must now use the shadow Dom's query selector for every panel, every element, anything that we hook into GrapesJS. Add...

AStoker

I updated the JSFiddle so you can see what we need to do to get styles within Shadow DOM. But unfortunately the CSS that's automatically added by GrapesJS exists on the body and is both polluting the global stylesheets and pointless due to...

#3560June 23, 2021by hadeel943 answers
2 reactions

Customize Blocks Styles - grapesjs Angular

I am new to grapes js , I am trying to make the blocks in a different style when dragging for example the image blocks 1 - when not dragged or hover takes style A . 2- when hover takes style B . 3- When dragged takes style C (when it is over the canvas). can any one help me with this issue . Thanks

ronaldohoch

Maybe with this events you can do it: https://grapesjs.com/docs/api/editor.html#blocks or https://grapesjs.com/docs/api/editor.html#canvas

artf

In such a case, probably a completely custom block manager UI is the only way (eg. rendered by your own BlockManager component in Angular). It should be possible already, but I'd prefer to take my time and update the Blocks documentation w...

hadeel94

In such a case, probably a completely custom block manager UI is the only way (eg. rendered by your own BlockManager component in Angular). It should be possible already, but I'd prefer to take my time and update the Blocks documentation w...

#3559June 22, 2021by iabhiyaan2 answers
0 reactions

BUG: page.getMainComponent().view gives undefined when page is selected

Hello @artf, I want to get the HTML Element of selected page. But it returns undefined when using following code:

artf

Hi @iabhiyaan, when page:select triggers, iframes inside the canvas are not yet loaded, so you just need to wait once they are loaded before accessing its DOM.

iabhiyaan

Thankyou @artf.

#3558June 22, 2021by aimeos3 answers
2 reactions

FEAT: Support Content-Security-Policy

To reduce the possible attack surface if the editor is used in "hostile" environments (e.g. in SaaS platforms) support for CSP is required. This will also prevent problems like https://github.com/artf/grapesjs/issues/3082 At the moment, the only problem that prevents effective CSP rules is the use of new Function() in...

artf

ok then, I'll try to fix it for the next release.

artf

mmm I'm not sure exactly how I'm able to fix it and what do you mean by is the use of new Function() in the GrapesJS code as there is no such a thing in the source?

aimeos

Found out that it's in the dist files due to underscore.js template() method which uses new Function(). I think this will make it hard to replace or remove that dependency to enforce a CSP without 'unsafe-eval'.

#3557June 22, 2021by acip3 answers
0 reactions

Upgrade - how to update old templates to the newest version?

I have some templates that were generated with v0.14.5. How can I "upgrade" them to the latest version? They have classes attached and I see that the newest version doesn't add classes to the elements anymore. Context: we use bespoke components and some defaults (e.g. draggable, resizable etc., style) have been change...

artf

They have classes attached and I see that the newest version doesn't add classes to the elements anymore. I'm not sure what you're talking about, classes should be imported as before.Context: we use bespoke components and some defaults (e....

acip

Hey, thanks for the quick response. Here is the template generated by v0.14.5 https://jsonblob.com/535ae06f-d4f6-11eb-8bc1-415e99da64cb This is how it looks https://ibb.co/Zz8qg2J We've changed some custom components' default attributes an...

acip

I've setup old vs new version for an existing template: https://grapesjs-templates-upgrade.ciprianamariei.repl.co/0.14.5-old-template.html https://grapesjs-templates-upgrade.ciprianamariei.repl.co/0.16.45-old-template.html

#3549June 19, 2021by anlumoNo answers
0 reactions

BUG: createCustomEvent Doesn't Handle Mouse Events Correctly

Version: 0.17.4 / git master Describe the bug detailed FrameView repackages keyboard and mouse events here: https://github.com/artf/grapesjs/blob/07061ae1307fedf2a3b9bd585ce0cb30f653f112/src/canvas/view/FrameView.js#L389-L399 I think the reason is related to redirecting iframe events to parent frame events. This would...