[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 `<input type='text'/>` options
	elements.

opw-2361169

closes odoo/odoo#60481

X-original-commit: 48d4c8185482545b049e2fecf315dd66ab9472f8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2020-10-21 18:06:50 +00:00
parent e37b0707e6
commit c73b42244c
@@ -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);