Issue #3061Opened October 2, 2020by timramseyjr0 reactions

BUG: adding changeProp: 1 to trait causes trait changes to not propagate to remote Storage

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)

artfOctober 10, 20200 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.