Closed Drew-Daniels closed 2 years ago
Here is the example I used for testing if anyone would like to try recreating this: https://github.com/Drew-Daniels/grapesjs-react-bug
After looking through the grapesjs
release notes again, I noticed a couple changes in v0.19.4
that I believe may have affected the grapesjs-mjml
plugin's ability to work with React. The screenshots below are taken from the v0.19.4
release notes:
Could the bug be related to changing the default canvas iframe mode? If anyone has more context on what this means that could be helpful.
Although I am not testing the ability to paste components onto the canvas, the warning/error I am seeing mentions the sorter
context:
Still getting this with grapejs 0.20.4 and mjml 1.0.4
@Drew-Daniels solution of adding
editorRef.current.onReady(() => {
editorRef.current!.DomComponents.clear();
editorRef.current!.setComponents(
'<mj-body><mj-wrapper></mj-wrapper></mj-body>',
);
});
works
This has had a temporary fix for a long time. wondering if anyone knows if this is the final solution?
My team has previously used
grapesjs v0.18.4
,grapesjs-mjml v0.6.6
andreact
together without issue. However, since the upgrade we made from0.18.4
to0.19.5
, the 3 no longer work together. I have created a simple example to illustrate the issue we're seeing.Summary:
When using
grapesjs v0.19.4
and up, whenever I try to drag a Section component onto a blank Canvas, I receive this warning:Video:
v0.19.4
and up: screen-capture (1).webmv0.18.4
: screen-capture (2).webmHere is my setup:
index.js
:App.js
:Builder.js
:config.js
:This appears to only be an issue when using
grapesjs v0.19.4
or higher along with thegrapesjs-mjml
plugin.What I have tried:
src/components/Body.js
:From:
To:
Setting the
config.canvas.frameStyle
property to the following insrc/index.js
(line 67):Adding
mjml
througheditor.addComponents
(and removing my JSX mjml within#gjs
):Nothing works, the only thing that makes a difference is downgrading to the previous version, which we do not want to do because of the XSS vulnerabilities that come with doing so.