From 5dc22e9273286e3b47b1fa2d8f038f7def4e658b Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Fri, 16 Jun 2017 10:26:54 +0300 Subject: [PATCH] Clicking autocomplete will return focus to text area, make the autocomplete box disappear after clicking on a name. --- src/components/post_status_form/post_status_form.js | 3 +++ src/components/post_status_form/post_status_form.vue | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index b1e5f84d..a8b4d39c 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -77,6 +77,9 @@ const PostStatusForm = { methods: { replace (replacement) { this.newStatus.status = Completion.replaceWord(this.newStatus.status, this.wordAtCaret, replacement) + const el = this.$el.querySelector('textarea') + el.focus() + this.caret = 0 }, setCaret ({target: {selectionStart}}) { this.caret = selectionStart diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index c578528b..a95f92ab 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -6,7 +6,7 @@
-
+
@{{candidate.screen_name}}