Skip to content
Snippets Groups Projects
Commit 5dc22e92 authored by Shpuld Shpuldson's avatar Shpuld Shpuldson
Browse files

Clicking autocomplete will return focus to text area, make the autocomplete...

Clicking autocomplete will return focus to text area, make the autocomplete box disappear after clicking on a name.
parent b24b891c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -6,7 +6,7 @@
</div>
<div style="position:relative;" v-if="candidates">
<div class="autocomplete-panel base05-background">
<div v-for="candidate in candidates" @click="replace('@' + candidate.screen_name)" class="autocomplete base01">
<div v-for="candidate in candidates" @click="replace('@' + candidate.screen_name + ' ')" class="autocomplete base01">
<img :src="candidate.img"></img>
<span>
@{{candidate.screen_name}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment