From c73b42244c5acae0d343ad898ccda6507d4fa973 Mon Sep 17 00:00:00 2001 From: "Nasreddin (bon)" Date: Wed, 21 Oct 2020 13:08:40 +0000 Subject: [PATCH] [FIX] web_editor: Autocomplete options can break layout Issue - Install "Website" app - Go to "Contact us" page on website - Edit Page, then click on submit button to edit form style - Alter 'Recipient Email' by selecting a value from 'autocomplete' values Other input text options are also altered. Cause Due to chrome autocompletition, others text input fields are also altered (like it will do with a form address). In this case, the error was obvious since it alter also the 'Labels Width' who break the layout. Solution Disable autocompletition on `` options elements. opw-2361169 closes odoo/odoo#60481 X-original-commit: 48d4c8185482545b049e2fecf315dd66ab9472f8 Signed-off-by: Nicolas Lempereur (nle) Signed-off-by: bon-odoo --- addons/web_editor/static/src/js/editor/snippets.options.js | 1 + 1 file changed, 1 insertion(+) 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 d7a62a388c0..305c5e5c39f 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1066,6 +1066,7 @@ const InputUserValueWidget = UnitUserValueWidget.extend({ const unit = this.el.dataset.unit; this.inputEl = document.createElement('input'); this.inputEl.setAttribute('type', 'text'); + this.inputEl.setAttribute('autocomplete', 'chrome-off'); this.inputEl.setAttribute('placeholder', this.el.getAttribute('placeholder') || ''); this.inputEl.classList.toggle('text-left', !unit); this.inputEl.classList.toggle('text-right', !!unit);