diff --git a/src/style_manager/model/Property.js b/src/style_manager/model/Property.js index 28c7a6afa..e576c6e42 100644 --- a/src/style_manager/model/Property.js +++ b/src/style_manager/model/Property.js @@ -73,7 +73,9 @@ const Property = Backbone.Model.extend( */ setValue(value, complete = 1, opts = {}) { const parsed = this.parseValue(value); - this.set(parsed, { ...opts, avoidStore: !complete }); + const avoidStore = !complete; + !avoidStore && this.set({ value: '' }, { avoidStore, silent: true }); + this.set(parsed, { ...opts, avoidStore }); }, /** diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index 3346cdb6c..a59e9e24e 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -469,6 +469,13 @@ export default Backbone.View.extend({ delete style[property]; } + // Forces to trigger the change (for UndoManager) + if (opts.avoidStore) { + style.__ = 1; + } else { + delete style.__; + } + target.setStyle(style, opts); // Helper is used by `states` like ':hover' to show its preview