Make it possible to auto-select the first candidate in autocomplete

This commit is contained in:
tusooa 2023-02-20 23:49:34 -05:00
commit 5468309f6a
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
5 changed files with 16 additions and 2 deletions

View file

@ -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,

View file

@ -501,6 +501,14 @@
{{ $t('settings.pad_emoji') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
path="autocompleteSelect"
expert="1"
>
{{ $t('settings.autocomplete_select_first') }}
</BooleanSetting>
</li>
</ul>
</div>
</div>