From 1495db084ae49cc5133678d61e19d90333cbe31d Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Thu, 19 Nov 2020 11:37:06 +0200 Subject: [PATCH] fix keyboard highlight --- src/components/emoji_input/emoji_input.js | 5 ++--- src/components/emoji_input/emoji_input.vue | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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)" >