Added autocomplete property
This commit is contained in:
parent
b214de25ce
commit
3c88a25c2a
|
@ -23,7 +23,6 @@ export default class Autocomplete extends Field {
|
||||||
|
|
||||||
this._selection = null;
|
this._selection = null;
|
||||||
this.input = this.element.querySelector('input');
|
this.input = this.element.querySelector('input');
|
||||||
this.input.setAttribute('autocomplete', 'off');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$postLink() {
|
$postLink() {
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
ng-model="$ctrl.search"
|
ng-model="$ctrl.search"
|
||||||
class="dense search"
|
class="dense search"
|
||||||
ng-blur="$ctrl.onFocusOut()"
|
ng-blur="$ctrl.onFocusOut()"
|
||||||
placeholder="{{::'Search' | translate}}">
|
placeholder="{{::'Search' | translate}}"
|
||||||
|
autocomplete="off">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</div>
|
</div>
|
||||||
<div class="list" tabindex="-1">
|
<div class="list" tabindex="-1">
|
||||||
|
|
|
@ -132,6 +132,17 @@ export default class Field extends FormInput {
|
||||||
return this.error || this.inputError || null;
|
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() {
|
refreshHint() {
|
||||||
let error = this.shownError;
|
let error = this.shownError;
|
||||||
let hint = error || this.hint;
|
let hint = error || this.hint;
|
||||||
|
@ -206,6 +217,7 @@ ngModule.vnComponent('vnField', {
|
||||||
controller: Field,
|
controller: Field,
|
||||||
bindings: {
|
bindings: {
|
||||||
type: '@?',
|
type: '@?',
|
||||||
|
autocomplete: '@?',
|
||||||
placeholder: '@?',
|
placeholder: '@?',
|
||||||
value: '=?',
|
value: '=?',
|
||||||
info: '@?',
|
info: '@?',
|
||||||
|
|
Loading…
Reference in New Issue