fix keyboard highlight

This commit is contained in:
Shpuld Shpuldson 2020-11-19 11:37:06 +02:00
parent 0f386ccbc7
commit 1495db084a
2 changed files with 3 additions and 4 deletions

View File

@ -184,11 +184,10 @@ const EmojiInput = {
if (this.textAtCaret !== textAtCaret) return
if (matchedSuggestions.length <= 0) return
this.suggestions = take(matchedSuggestions, 5)
.map(({ imageUrl, ...rest }, index) => ({
.map(({ imageUrl, ...rest }) => ({
...rest,
// eslint-disable-next-line camelcase
img: imageUrl || '',
highlighted: index === this.highlighted
img: imageUrl || ''
}))
},
suggestions (newValue) {

View File

@ -37,7 +37,7 @@
v-for="(suggestion, index) in suggestions"
:key="index"
class="autocomplete-item"
:class="{ highlighted: suggestion.highlighted }"
:class="{ highlighted: index === highlighted }"
@click.stop.prevent="onClick($event, suggestion)"
>
<span class="image">