From e116a69f25d3d3dcfa9ee12b34c33d9c3658bb46 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Tue, 30 May 2017 11:28:05 +0200 Subject: [FIX] web: properly handle autocomplete attribute With the new views, the attribute autocomplete on input was no longer supported. We simply reintroduce its support in this commit. The basic attribute values are 'on' and 'off' but one may want to use a random string. Note that an input with type='password' is a special case: the autocomplete attribute should always be set to 'new-password' to remove autocompletion (autocomplete='off' doesn't actually remove the autocompletion). --- addons/web/static/src/js/fields/basic_fields.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index cdaed1d7b4f..a5ceba50d3f 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -225,6 +225,9 @@ var InputField = DebouncedField.extend({ this.$input.attr({ type: this.nodeOptions.isPassword ? 'password' : 'text', placeholder: this.attrs.placeholder || "", + autocomplete: this.nodeOptions.isPassword ? + 'new-password' : + this.attrs.autocomplete, }); this.$input.val(this._formatValue(this.value)); return this.$input; -- cgit v1.2.3