From 642cde64546b15cdabb84e1a4f504f55da3efe0f Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 10 Dec 2021 17:36:19 +0100 Subject: [PATCH] Update __upTargetsStyle --- src/style_manager/model/PropertyComposite.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index 79a4a5190..6de822065 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -44,7 +44,11 @@ export default Property.extend({ if (!this.__hasCustom() || opts.__up || opts.__clearIn) return; if (this.isDetached()) { - this.__upTargetsStyle({ [prop.getName()]: prop.__getFullValue() }, opts); + const style = this.getProperties().reduce((acc, prop) => { + acc[prop.getName()] = prop.hasValue({ noParent: true }) ? prop.__getFullValue() : ''; + return acc; + }, {}); + this.__upTargetsStyle({ ...style, [prop.getName()]: prop.__getFullValue() }, opts); } else { const { __clear, ...rest } = opts; this.upValue(this.__getFullValue(), rest); @@ -60,7 +64,9 @@ export default Property.extend({ newStyle = toStyle(values, { ...opts, style }); } - if (!this.isDetached()) { + if (this.isDetached()) { + newStyle[this.getName()] = ''; + } else { this.getProperties().map(prop => { newStyle[prop.getName()] = ''; });