aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_input/emoji_input.js
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-11-19 12:35:21 +0200
committerShpuld Shpuldson <shp@cock.li>2020-11-19 12:35:21 +0200
commit419df9d44673bf1abe3cda7ba6cafee9dd6eaba4 (patch)
tree97ad063dec7f93aec054323eeaac103f79724941 /src/components/emoji_input/emoji_input.js
parent1cd222d85ce578fbbefb51f9d0b6df569a33bf4e (diff)
update some documentation
Diffstat (limited to 'src/components/emoji_input/emoji_input.js')
-rw-r--r--src/components/emoji_input/emoji_input.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index d32e19bf..3deeb6c8 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -175,13 +175,13 @@ const EmojiInput = {
showSuggestions: function (newValue) {
this.$emit('shown', newValue)
},
- textAtCaret: async function (textAtCaret) {
- const firstchar = textAtCaret.charAt(0)
+ textAtCaret: async function (newWord) {
+ const firstchar = newWord.charAt(0)
this.suggestions = []
- if (textAtCaret === firstchar) return
- const matchedSuggestions = await this.suggest(textAtCaret)
- // Async, cancel if textAtCaret has been updated while waiting
- if (this.textAtCaret !== textAtCaret) return
+ if (newWord === firstchar) return
+ const matchedSuggestions = await this.suggest(newWord)
+ // Async: cancel if textAtCaret has changed during wait
+ if (this.textAtCaret !== newWord) return
if (matchedSuggestions.length <= 0) return
this.suggestions = take(matchedSuggestions, 5)
.map(({ imageUrl, ...rest }) => ({