From d8b377b8b80365e04248f55e43c4313f9e98bec1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 13 Apr 2022 18:10:52 +0200 Subject: [PATCH] Remove empty style properties --- src/domain_abstract/model/Styleable.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/domain_abstract/model/Styleable.js b/src/domain_abstract/model/Styleable.js index 301aa0dd3..dca081992 100644 --- a/src/domain_abstract/model/Styleable.js +++ b/src/domain_abstract/model/Styleable.js @@ -40,7 +40,14 @@ export default { const propOrig = this.getStyle(opts); const propNew = { ...prop }; - this.set('style', propNew, opts); + const newStyle = { ...propNew }; + // Remove empty style properties + keys(newStyle).forEach(prop => { + if (newStyle[prop] === '') { + delete newStyle[prop]; + } + }); + this.set('style', newStyle, opts); const diff = shallowDiff(propOrig, propNew); // Delete the property used for partial updates delete diff.__p;