Adding changeProp: 1 to trait causes trait changes to not propagate to remote Storage
changeProp in this case updates the component property and being custom is not tracked. As a workaround you can propagate them in this way (in your custom component model)
Read full answer below ↓Question
Version: 0.16.22
What is the expected behavior?
changing Trait property(columns in demo) should trigger POST to remote storage regardless of changeProp
traits: [
{
label: 'Columns(Change doesn't POST)',
name: 'columns-not-changing',
changeProp: 1,
type: 'number'
},
{
label: 'Columns(Change does POST)',
name: 'columns',
type: 'number'
}
]
https://jsfiddle.net/tntramsey/vgbeLarj/3/ - changing columns on the 'Test Plugin' initiates a POST to the remote storage
https://jsfiddle.net/tntramsey/n7tgojhy/4/ - Adding changeProp: 1 to the trait and changing Columns does not POST to remote storage
Answers (1)
changeProp in this case updates the component property and being custom is not tracked. As a workaround you can propagate them in this way (in your custom component model)
...
init() {
...
this.on('change:columns-not-changing', (...args) => editor.getModel().handleUpdates(...args))
}
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3655
The form button name changes are not getting captured in generated html code
Version: Version 0.17.19(grapesjs) Version 0.1.11(grapesjs-preset-webpage) Are you able to reproduce the bug from the demo?[ ] No What is t...
Issue #1092
[BUG]traits and storage trigger
Hey, maybe it's not bug, i'm not sure. I have traits with changeProp: true field. When I change the value of trait by UI, model is changed...
Issue #5503
replaceWith method doesn't have string type
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link none Describ...
Issue #3301
Change one copied element affects other copied elements
Version:0.16.41 Are you able to reproduce the bug from the demo? Yes What is the expected behavior? When I'm copying/pasting elements (e.g....
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.