From 1e576ee899d7c87a56072a812c5e11085f40cbf2 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 5 Feb 2020 21:31:15 +0000 Subject: [PATCH] [FIX] web_editor: consider negative values in the left panel A negative value, even if legit, was not understood by the editor and induced empty inputs in the left panel. closes odoo/odoo#44683 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/common/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/common/utils.js b/addons/web_editor/static/src/js/common/utils.js index c05e7a2064e..2608bafedbf 100644 --- a/addons/web_editor/static/src/js/common/utils.js +++ b/addons/web_editor/static/src/js/common/utils.js @@ -102,7 +102,7 @@ function _convertNumericToUnit(value, unitFrom, unitTo, cssProp, $target) { * @returns {Array|null} */ function _getNumericAndUnit(value) { - const m = value.trim().match(/^([0-9.]+)(\w*)$/); + const m = value.trim().match(/^(-?[0-9.]+)(\w*)$/); if (!m) { return null; }