From 81ca8647aa3cca3a17dbdf605e45550fa7378c44 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 25 Sep 2020 14:37:13 +0000 Subject: [PATCH] [FIX] web_editor: make we-input full-width if unit is large The design was made considering the units would not be bigger than 2 or 3 characters... but it is currently used with translated texts like "products". In those cases, force the input to be full-width. task-2312878 closes odoo/odoo#58787 X-original-commit: b1f9057af0d38176985ecfbe125ae992422b9744 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.options.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 671f973a0a9..c7b30f86dfd 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1043,6 +1043,9 @@ const InputUserValueWidget = UnitUserValueWidget.extend({ var unitEl = document.createElement('span'); unitEl.textContent = unit; this.containerEl.appendChild(unitEl); + if (unit.length > 3) { + this.el.classList.add('o_we_large_input'); + } }, //--------------------------------------------------------------------------