`setStyle` & `setComponents` options parameter not taken into account
Thanks @mcottret the fix is ready for the next release
Read full answer below βQuestion
Version: 0.16.30 Are you able to reproduce the bug from the demo? [x] Yes [ ] No Steps to reproduce:Open the consoleExecute editor.setComponents('', {avoidStore: true});Execute editor.setStyle('', {avoidStore: true});The "Stored ..." log still appears (see attached screenshot) What is the expected behavior? The options parameter should be taken into account. Passing the avoidStore option to true to setStyle & setComponents should prevent the update event from triggering. What is the current behavior? The options parameter is not taken into account. Passing the avoidStore option has no effect...
Answers (4)
Thanks @mcottret the fix is ready for the next release
Unfortunately, due to the bad initial naming, avoidStore is intended to skip the UndoManager and not the Storage π The good news, I had to introduce the new noCount option, in order to fix #3189, this will skip triggering the editor changes counter so, it won't trigger the Storage either. That fix...
Hello @artf ! I'm sorry to reopen this issue but the setStyle issue still seems to be present. Redoing the steps above, the "Stored ..." log still appears while calling setStyle with the noCount option. I'm seeing the fixed handleChanges handler still uses the avoidStore option, but the avoidStore...
Thanks for reporting this, @mcottret. The issue with setStyle & setComponents options parameter not taken into account appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent st...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3693
AdoptStylesheet not supported in grapesJS
Version: You can get the version by typing grapesjs.version into the console 0.17.22 Are you able to reproduce the bug from the demo?[x] Ye...
Issue #3137
When I select an particular element I'm not getting its styles. This issue happens only with some elements.
Not getting styles of the selected element Here is my code, const model = editor.StyleManager.getModelToStyle(component); let styleObject =...
Issue #3175
Selection & active RTE not cleared when component is removed programatically
Version: 0.16.30 Are you able to reproduce the bug from the demo? [x] Yes [ ] No Steps to reproduce:Select a text component in the demo's c...
Issue #4900
SetStyle/getCss() produces duplicated css
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome LatestReproducible demo link https://...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins β TinyMCE Inline Text Editor and Placeholder.
Tutorial
Find the Right GrapesJS Plugin in Seconds: Smarter Discovery Is Live
We're shipping a set of discovery upgrades. New label filters, a proper compatibility switch for GrapesJS vs Studio, one-click and a smarter sort bar.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.