mjml
mjml copied to clipboard
Making modifications without refreshing the page ?
Hi everyone,
I have a question about GrapesJS with MJML.
When I go on this page : https://grapesjs.com/demo-mjml.html,
Let’s say I’d like to change the color of the title « My Company » and make it red.
It’s working fine, the title turns to red.
But then if I want to put « My Company » in bold it doesn’t work. If I wan’t to make it work I have to refresh the page and then to put it in bold.
Does someone have an idea to make it work without refresh the page please and without using the style manager ?
Thank you !
Thomas
I'm facing this issue too, but it's when I drag a custom block 'mj-column' or 'mj-group'... Did you find any solution ? Thx !
Hi ! Unfortunately I didn't find the solution to my problem, so I can't help you on this right now... Sorry ! Thomas
No problem, if it could help I got this solution. I put a listener (here when I drag a specific block), and I 'refresh' the canvas by loading the current data:
this.Editor.on('block:drag:stop', (block, component) => {
if (component.id === 'mycustomcomponent-id') {
const data = this.Editor.storeData()
this.Editor.DomComponents.clear()
this.Editor.loadData(data)
}
})
No problem, if it could help I got this solution. I put a listener (here when I drag a specific block), and I 'refresh' the canvas by loading the current data:
this.Editor.on('block:drag:stop', (block, component) => { if (component.id === 'mycustomcomponent-id') { const data = this.Editor.storeData() this.Editor.DomComponents.clear() this.Editor.loadData(data) } })
Thank you very much for your help ! It worked for me !
Have a nice day !
Thomas
Shouldn't be an issue anymore