Change type of element but keep already set properties

Some properties (for example extension elements) are not copied by default. To copy your properties do:

eventBus.on('moddleCopy.canCopyProperty', HIGH_PRIORITY, function(context) {
  var property = context.property;

  if (is(property, 'myCustomProperty')) {

    // return copied property
    return copyMyCustomProperty(property);
  }
});
1 Like