aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_input/emoji_input.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2023-02-27 14:09:28 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2023-02-27 14:09:28 +0000
commit602c48d1fb1aded83cc59365f7bb2d1a375c51b3 (patch)
treeec247f37a44f507ca36f53b32bc99b847d74fcf1 /src/components/emoji_input/emoji_input.js
parenteec27700f0199e6f9cf478a4945d6939d28e5931 (diff)
parent5468309f6aefbc61467338d2a96f29d6c416cc54 (diff)
Merge branch 'tusooa/1250-autocomplete-select' into 'develop'
Make it possible to auto-select the first candidate in autocomplete Closes #1250 See merge request pleroma/pleroma-fe!1789
Diffstat (limited to 'src/components/emoji_input/emoji_input.js')
-rw-r--r--src/components/emoji_input/emoji_input.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index 8a8d098d..68654f69 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -134,6 +134,9 @@ const EmojiInput = {
padEmoji () {
return this.$store.getters.mergedConfig.padEmoji
},
+ defaultCandidateIndex () {
+ return this.$store.getters.mergedConfig.autocompleteSelect ? 0 : -1
+ },
preText () {
return this.modelValue.slice(0, this.caret)
},
@@ -287,7 +290,7 @@ const EmojiInput = {
...rest,
img: imageUrl || ''
}))
- this.highlighted = -1
+ this.highlighted = this.defaultCandidateIndex
this.$refs.screenReaderNotice.announce(
this.$tc('tool_tip.autocomplete_available',
this.suggestions.length,