From 529fdf742e68377a6107032cd01ce5e515c54710 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 15 Nov 2020 17:49:11 +0100 Subject: [PATCH] Destroy correctly the color picker --- src/domain_abstract/ui/InputColor.js | 5 +++++ src/style_manager/view/PropertyColorView.js | 1 + 2 files changed, 6 insertions(+) diff --git a/src/domain_abstract/ui/InputColor.js b/src/domain_abstract/ui/InputColor.js index d60c09eab..0506bc0e5 100644 --- a/src/domain_abstract/ui/InputColor.js +++ b/src/domain_abstract/ui/InputColor.js @@ -28,6 +28,11 @@ export default Input.extend({ return `${this.ppfx}input-holder`; }, + remove() { + Input.prototype.remove.apply(this, arguments); + this.colorEl.spectrum('destroy'); + }, + /** * Set value to the model * @param {string} val diff --git a/src/style_manager/view/PropertyColorView.js b/src/style_manager/view/PropertyColorView.js index 6831e9a56..0c4b4e58f 100644 --- a/src/style_manager/view/PropertyColorView.js +++ b/src/style_manager/view/PropertyColorView.js @@ -9,6 +9,7 @@ export default PropertyIntegerView.extend({ remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); + this.inputInst.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); },