diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index 16243a56..d32e19bf 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -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) { diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index 224e72cf..107e16c1 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -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)" >