Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use CKEditor to update text styling after using style manager #193

Closed
rcloss opened this issue Aug 3, 2020 · 8 comments
Closed

can't use CKEditor to update text styling after using style manager #193

rcloss opened this issue Aug 3, 2020 · 8 comments

Comments

@rcloss
Copy link

rcloss commented Aug 3, 2020

I'm not sure how to resolve this. If I haven't chosen any style options from the style manager for a block I can use CKEditor (installed via the grapesjs plugin) and all the font changes work, but if I have set something with Style Manager, I can no longer use CKEditor to change anything, I thought maybe mjml was overriding the CKEditor styles, but I can't even use i, b or u tags once something has been chosen from the Style Manager. If necessary I can disable the style manager stuff and just use CKEditor, but this still seems like an bug

@DRoet
Copy link
Collaborator

DRoet commented Aug 5, 2020

Could you maybe provide a reproduction / git repo? so it's easier to figure out what is going on.

@rcloss
Copy link
Author

rcloss commented Aug 6, 2020

It's happening without any major modifications, I'm using grapesjs-mjml 0.1.17 (it's the last one with a dist folder, haven't built a newer one yet, but I don't see a fix in the release notes) and grapesjs 0.16.17

Here's my settings:

var editor = grapesjs.init({
container: '#gjs',
height: '100%',
avoidInlineStyle: false,
fromElement: true,
clearOnRender: true,
plugins: ['grapesjs-mjml', 'gjs-plugin-ckeditor'],
pluginsOpts: {
  'grapesjs-mjml': {
    columnsPadding: '0',
  },
  'gjs-plugin-ckeditor': {
    position: 'center',
    options: {
      startupFocus: true,
      extraAllowedContent: '();{}',
      allowedContent: true,
      enterMode: CKEDITOR.ENTER_BR,
      extraPlugins: 'justify,colorbutton,panelbutton,font,placeholder,mnlink',
      toolbarGroups: [
        {name: 'document', groups: ['mode', 'document', 'doctools']},
        {name: 'clipboard', groups: ['clipboard', 'undo']},
        {name: 'editing', groups: ['find', 'selection', 'spellchecker', 'editing']},
        {name: 'forms', groups: ['forms']},
        {name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
        {name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi', 'paragraph']},
        {name: 'links', groups: ['links']},
        {name: 'insert', groups: ['insert']},
        '/',
        {name: 'styles', groups: ['styles']},
        {name: 'colors', groups: ['colors']},
        {name: 'tools', groups: ['tools']},
        {name: 'others', groups: ['others']},
        {name: 'about', groups: ['about']}
      ],
      removeButtons: 'Source,Save,NewPage,Preview,Print,Templates,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Find,Replace,Scayt,Language,Anchor,Image,Flash,PageBreak,Iframe'
    }
  }
}
});

So if I drag a column and a text block I can edit the italic/bold/whatever with CK Editor, but as soon as I do something like center it with the style manager I can no longer do anything with the CKEditor

update: I also tried this with the MJML plugin disabled and using the style manager doesn't stop the CKEditor from working in that case.

@DRoet
Copy link
Collaborator

DRoet commented Aug 6, 2020

Any reason you need the dist folder? the dist folder is still being published to npm and various cdns

@rcloss
Copy link
Author

rcloss commented Aug 6, 2020

no, I just haven't got around to upgrading yet, because it wasn't handy here on github. If the newer version fix this bug I can upgrade but I didn't see anything pressing in the release notes to warrant it

@rcloss
Copy link
Author

rcloss commented Aug 12, 2020

I got back to this and updated to 0.2.4 today and there's still the conflict with the CKEditor plugin, as soon as I change anything in Typography the CKEditor can no longer update bold, italic, etc...

@gl-ll
Copy link

gl-ll commented Feb 23, 2021

I get the same issue on demo https://grapesjs.com/demo-mjml.html

To reproduce :

  1. select a text block
  2. click on Style Manager > Typography and change the font size
  3. open gjs-plugin-ckeditor on the same text block
  4. bold the text with gjs-plugin-ckeditor

Issue : imposible to complete step 4.

yanfanvip added a commit to yanfanvip/grapesjs-plugin-ckeditor that referenced this issue Nov 6, 2021
@annamunk
Copy link

annamunk commented Oct 20, 2022

I still have the same issue with mjml emails but fix Rte destroy on disable seems to work for me. @artf @DRoet is there a chance that it will be resolved soon?

If this somehow helps to fix the problem, when the gjs-plugin-ckeditor stops working, trying to convert the selected text to a bulleted or numbered list returns an error in the console:

ckeditor.js:186 Uncaught TypeError: Cannot read properties of null (reading 'isContextFor')
at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.command.refresh (ckeditor.js:186:481)
at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.command.exec (ckeditor.js:715:448)
at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.command.exec (ckeditor.js:186:379)
at a.execCommand (ckeditor.js:252:231)
at CKEDITOR.tools.extend.click (ckeditor.js:766:419)
at Object.execute (ckeditor.js:767:490)
at ckeditor.js:768:326
at ckeditor.js:29:180
at Object.callFunction (ckeditor.js:29:296)
at HTMLAnchorElement.onclick (demo-mjml.html:1:16)

@artf
Copy link
Member

artf commented Jun 19, 2023

Closing this as from the demo the issue seems to be resolved

@artf artf closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants