From d95a35de1cf34f940d532a2e8b7198396bb572b7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Fri, 18 Nov 2022 12:51:06 +0400 Subject: [PATCH] Fix style manager with rules containing !important. Closes #4719 --- src/style_manager/model/Property.js | 4 ++-- src/style_manager/view/PropertyView.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 56258b7b6..69ce8c18d 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -362,7 +362,7 @@ export default class Property extends Model { * @return {string} * @private */ - getFullValue(val) { + getFullValue(val, opts = {}) { const fn = this.get('functionName'); const def = this.getDefaultValue(); let value = isUndefined(val) ? this.get('value') : val; @@ -377,7 +377,7 @@ export default class Property extends Model { value = `${fn}(${fnParameter})`; } - if (hasValue && this.get('important')) { + if (hasValue && this.get('important') && !opts.skipImportant) { value = `${value} !important`; } diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 9236134af..50dbe8a5c 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -127,7 +127,7 @@ export default class Property extends View { } onValueChange(m, val, opt = {}) { - this.setValue(this.model.getFullValue()); + this.setValue(this.model.getFullValue(undefined, { skipImportant: true })); this.updateStatus(); }