From 5468309f6aefbc61467338d2a96f29d6c416cc54 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 20 Feb 2023 23:49:34 -0500 Subject: Make it possible to auto-select the first candidate in autocomplete --- src/components/emoji_input/emoji_input.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/components/emoji_input/emoji_input.js') 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, -- cgit v1.2.3-70-g09d2