From 17c70fc0ef380d1faa360aa5b91791fd44d6c419 Mon Sep 17 00:00:00 2001 From: Xiaofeng An Date: Fri, 8 Feb 2019 11:02:28 -0500 Subject: [PATCH] add id & placeholder props to AutoCompleteInput component --- src/components/autocomplete_input/autocomplete_input.js | 3 +++ src/components/autocomplete_input/autocomplete_input.vue | 3 ++- src/components/post_status_form/post_status_form.vue | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/autocomplete_input/autocomplete_input.js b/src/components/autocomplete_input/autocomplete_input.js index 51c1f5d9..0f1a510c 100644 --- a/src/components/autocomplete_input/autocomplete_input.js +++ b/src/components/autocomplete_input/autocomplete_input.js @@ -3,9 +3,12 @@ import { take, filter, map } from 'lodash' const AutoCompleteInput = { props: [ + 'id', 'classObj', 'value', + 'placeholder', 'autoResize', + 'multiline', 'drop', 'dragoverPrevent', 'paste', diff --git a/src/components/autocomplete_input/autocomplete_input.vue b/src/components/autocomplete_input/autocomplete_input.vue index d3bda597..309f2202 100644 --- a/src/components/autocomplete_input/autocomplete_input.vue +++ b/src/components/autocomplete_input/autocomplete_input.vue @@ -4,9 +4,10 @@ v-if="multiline" ref="textarea" :value="text" + :id="id" @input="text = $event.target.value, $emit('input', $event.target.value), autoResize && resize($event)" @click="setCaret" - @keyup="setCaret" :placeholder="$t('post_status.default')" rows="1" :class="classObj" + @keyup="setCaret" :placeholder="placeholder" rows="1" :class="classObj" @keydown.down="cycleForward" @keydown.up="cycleBackward" @keydown.shift.tab="cycleBackward" diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index ac5f5566..18c2d2b2 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -18,7 +18,9 @@ class="form-cw">