FEAT: get property value by component:styleUpdate event
Question
The Changed property name can only be got in component:styleUpdate event, but I cannot get the value of the property.
editor.on('component:styleUpdate', (comp, prop) => { // prop is the updated property name })
Thanks
Answers (1)
You can take the value directly from the component comp.getStyle()[prop]
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1904
Get change in property float
I'm trying to listen to the change in the 'float' property whether it was shifted to the 'left' or 'right' or 'none' in Style Manager using...
Issue #1708
StyleManager events fire multiple times per change
To reproduce: On a fresh install of GrapesJS, within the demo page (within index.html), add an event listener like so: editor.on('component...
Issue #2771
[BUG] component with textable:1 not working since version 0.16.12
Hello, I've just updated to the lasted version 0.16.12 and have a bug when trying to move a component that has the property textable:1 into...
Issue #2654
How to get the changed property from StyleManager
Hi, Is there a way to find out which property was changed in the StyleManager? For eg. If I select a Text component and change its backgrou...
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.