From 85ae9771f075ce71ed59074b1e381506e31d294d Mon Sep 17 00:00:00 2001 From: Erik Nygren Date: Sat, 9 Feb 2019 23:05:00 +0000 Subject: [PATCH] Make autocomplete value a prop (#730) What --- - Turn the autocomplete value on the `input` configurable by exposing it as a prop. Why --- So it can be customised, which can be necessary to help developers show or hide autocomplete forms as they wish. --- docs/gitbook/Api/Props.md | 10 ++++++++++ src/components/Select.vue | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/gitbook/Api/Props.md b/docs/gitbook/Api/Props.md index bee89f1..5930408 100644 --- a/docs/gitbook/Api/Props.md +++ b/docs/gitbook/Api/Props.md @@ -34,6 +34,16 @@ disabled: { default: false }, +/** + * Value of the 'autocomplete' field of the input + * element. + * @type {String} + */ +autocomplete: { + type: String, + default: 'off' +}, + /** * Sets the max-height property on the dropdown list. * @deprecated diff --git a/src/components/Select.vue b/src/components/Select.vue index 40ad91d..43ff4c2 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -336,7 +336,7 @@ @focus="onSearchFocus" type="search" class="form-control" - autocomplete="off" + :autocomplete="autocomplete" :disabled="disabled" :placeholder="searchPlaceholder" :tabindex="tabindex" @@ -512,6 +512,17 @@ default: 'label' }, + + /** + * Value of the 'autocomplete' field of the input + * element. + * @type {String} + */ + autocomplete: { + type: String, + default: 'off' + }, + /** * Tells vue-select what key to use when generating option * values when each `option` is an object.