Style:property:update and Property onChange trigger excessively
The behaviour is correct as style:property:update triggers on any update of the Style Manager Property (not only its value). So for your specific case you would need to update the callback in this way
Read full answer below βQuestion
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 112.0.5615.137 (Official Build) Reproducible demo link https://jsfiddle.net/SagarMaria/sunygp2f/3/ Describe the bug How to reproduce the bug?In the jsfiddle simply click on the "Hello World" component. Observe the numerous console logs.Click away elsewhere on the canvas, repeat. What is the expected behavior? style:property:update should only trigger on some style property change for the selected component What is the current behavior? style:property:update event is instead firing n...
Answers (3)
The behaviour is correct as style:property:update triggers on any update of the Style Manager Property (not only its value). So for your specific case you would need to update the callback in this way
Hi @artf, thanks for the quick reply, but actually, part of the problem is still that even after making a change e.g. click "center" align radio option with the if statement you suggested, subsequent selections of that component still log out style:property:update value with property and to set as...
The issue you're encountering with style:property:update and Property onChange firing excessively, even on component selection, is a common point of confusion. The style:property:update event is a low-level event that triggers whenever a style property model is updated internally. When a component...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4576
Clicking 'wrap for style' button affects the inner components of other components inside the same text box
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome 104.0.5112.101 Reproducible demo link...
Issue #6706
TypeError: e.getRoot is not a function (Race condition in Style Manager)
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? All browsers (Chrome, Safari, Firefox, Edg...
Issue #4350
Style Manager don't update background when component is selected
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Brave Browser V1.39.111 Reproducible demo...
Issue #5990
When you delete a component, duplicate classes between components will be deleted.
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 126.0.6478.127(Windows) Reproducibl...
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.