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
@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.
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)
Most helpful comment
Thanks for the report, there is a bug with the
editor.loadmethod, which could be currently patched in this wayActually, 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 theautoload(trueby default) will work correctly (without any temporary patch on your side)