From 0cd4e2ad9ed2c82071942b2b1c6c748f4c62476e Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 10 Mar 2020 14:28:50 +0100 Subject: [PATCH] Added autocomplete property --- front/core/components/autocomplete/index.js | 1 - front/core/components/drop-down/index.html | 3 ++- front/core/components/field/index.js | 12 ++++++++++++ modules/ticket/front/index/index.html | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 1d3c6e243..38c85db57 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -23,7 +23,6 @@ export default class Autocomplete extends Field { this._selection = null; this.input = this.element.querySelector('input'); - this.input.setAttribute('autocomplete', 'off'); } $postLink() { diff --git a/front/core/components/drop-down/index.html b/front/core/components/drop-down/index.html index 5366d9d90..52ceeeaae 100644 --- a/front/core/components/drop-down/index.html +++ b/front/core/components/drop-down/index.html @@ -3,7 +3,8 @@ ng-model="$ctrl.search" class="dense search" ng-blur="$ctrl.onFocusOut()" - placeholder="{{::'Search' | translate}}"> + placeholder="{{::'Search' | translate}}" + autocomplete="off">
diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 481ccce91..18286175b 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -132,6 +132,17 @@ export default class Field extends FormInput { return this.error || this.inputError || null; } + get autocomplete() { + return this._autocomplete; + } + + set autocomplete(value) { + this._autocomplete = value; + console.log(value); + if (value === 'off') + this.input.setAttribute('autocomplete', 'off'); + } + refreshHint() { let error = this.shownError; let hint = error || this.hint; @@ -206,6 +217,7 @@ ngModule.vnComponent('vnField', { controller: Field, bindings: { type: '@?', + autocomplete: '@?', placeholder: '@?', value: '=?', info: '@?', diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index ee218df56..6a0b051ec 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -129,7 +129,7 @@
-