BUG: Autosave not working on style manager when classes are disabled
Question
Version: 0.16.18
Are you able to reproduce the bug from the demo?
[x ] Yes: https://jsfiddle.net/ju1a0onx/
What is the expected behavior?
Autosave should always call the "store" command after a style change, even when the classes are disabled
What is the current behavior?
When you disable all classes on an element (Or set them all to private - not shown in this sample) and make a style change, the Autosave doesn't kick in, and your changes aren't saved.
Are you able to attach screenshots, screencasts or a live demo?
[x ] Yes Grapesjs autosave bug.zip
Answers (3)
Thanks for the report, there is a bug with the editor.load method, which could be currently patched in this way
editor.load(() => {
const em = editor.getModel();
em.get('storables').forEach(md => md.postLoad && md.postLoad(em));
});
Actually, if you have used editor.load() only because it doesn't load on start, that because you have to define your custom storage in a plugin, in that way the autoload (true by default) will work correctly (without any temporary patch on your side)
@Davidvlv I'm experiencing the same issue. I believe it's a combination of the avoidInlineStyles: 1 in the config and no class being selected. It seems to work as expected with avoidInlineStyles: 0
I've tried it out, and that setting does stop it from not saving when it should, but it introduces some other issues on our end with how we're using the output later on. We turned on avoidInlineStyles to avoid these issues.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3005
BUG: Layer manager appendTo is duplicating the layers every time grapesjs is init
Version: 0.16.18 and up (The issue was introduced somewhere after 0.15.3, not sure when) Are you able to reproduce the bug from the demo? [...
Issue #3125
BUG: linear-gradient CSS does weird things to background-image
Version: 0.16.27 Are you able to reproduce the bug from the demo? [x] Yes [ ] No What is the expected behavior? When adding background-imag...
Issue #3681
BUG: Textable not working with extended text component
Version: 0.17.22 Are you able to reproduce the bug from the demo?[X] Yes[ ] No What is the expected behavior? Should be able to drop a text...
Issue #3166
BUG: Problem with copy and paste a node
*Version:0.16.27 Are you able to reproduce the bug from the demo? [ ] Yes [ ] No What is the expected behavior? In the right panel and canv...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.