thanhtunguet / grapesjs-react

A React wrapper for GrapesJS library
https://thanhtunguet.github.io/grapesjs-react
194 stars 58 forks source link

drag'n'drop broken with MJML preset #31

Closed DigiPascal closed 4 years ago

DigiPascal commented 4 years ago

Hi,

I have an issue when using the MJML preset. I think When I use preset newsletter everything is fine when I switch to MJML, I have the editor loading without any error but it not possible to drag n drop anything into the content (content does not add).

I guess the initialisation is not correct, because when I select the source in the editor. I get a strange output in the mjml code section (should be mjml instead): image

This is my editor settings :

import React from 'react';
import 'grapesjs/dist/css/grapes.min.css';
import {Editor} from 'grapesjs-react';
import {grapesJSMJML} from 'grapesjs-mjml';
import './App.css';

Editor.defaultProps = {
  id: 'grapesjs-react-editor',
  presetType: 'mjml',
  plugins: [grapesJSMJML],
  pluginsOpts: {
     [grapesJSMJML]: { }
  },
  blocks: [],
  blockManager: {},
  storageManager: {},
  styleManager: {},
  width: 'auto',
  height: '100vh',
};

function App() {
  return (
    <div className="App">
      <Editor />
    </div>
  );
}
export default App;
thanhtunguet commented 4 years ago

Duplicated of #26