fix keyboard highlight
This commit is contained in:
parent
0f386ccbc7
commit
1495db084a
2 changed files with 3 additions and 4 deletions
|
@ -184,11 +184,10 @@ const EmojiInput = {
|
||||||
if (this.textAtCaret !== textAtCaret) return
|
if (this.textAtCaret !== textAtCaret) return
|
||||||
if (matchedSuggestions.length <= 0) return
|
if (matchedSuggestions.length <= 0) return
|
||||||
this.suggestions = take(matchedSuggestions, 5)
|
this.suggestions = take(matchedSuggestions, 5)
|
||||||
.map(({ imageUrl, ...rest }, index) => ({
|
.map(({ imageUrl, ...rest }) => ({
|
||||||
...rest,
|
...rest,
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
img: imageUrl || '',
|
img: imageUrl || ''
|
||||||
highlighted: index === this.highlighted
|
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
suggestions (newValue) {
|
suggestions (newValue) {
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
v-for="(suggestion, index) in suggestions"
|
v-for="(suggestion, index) in suggestions"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="autocomplete-item"
|
class="autocomplete-item"
|
||||||
:class="{ highlighted: suggestion.highlighted }"
|
:class="{ highlighted: index === highlighted }"
|
||||||
@click.stop.prevent="onClick($event, suggestion)"
|
@click.stop.prevent="onClick($event, suggestion)"
|
||||||
>
|
>
|
||||||
<span class="image">
|
<span class="image">
|
||||||
|
|
Loading…
Reference in a new issue