Make it possible to auto-select the first candidate in autocomplete
This commit is contained in:
parent
eec27700f0
commit
5468309f6a
@ -134,6 +134,9 @@ const EmojiInput = {
|
|||||||
padEmoji () {
|
padEmoji () {
|
||||||
return this.$store.getters.mergedConfig.padEmoji
|
return this.$store.getters.mergedConfig.padEmoji
|
||||||
},
|
},
|
||||||
|
defaultCandidateIndex () {
|
||||||
|
return this.$store.getters.mergedConfig.autocompleteSelect ? 0 : -1
|
||||||
|
},
|
||||||
preText () {
|
preText () {
|
||||||
return this.modelValue.slice(0, this.caret)
|
return this.modelValue.slice(0, this.caret)
|
||||||
},
|
},
|
||||||
@ -287,7 +290,7 @@ const EmojiInput = {
|
|||||||
...rest,
|
...rest,
|
||||||
img: imageUrl || ''
|
img: imageUrl || ''
|
||||||
}))
|
}))
|
||||||
this.highlighted = -1
|
this.highlighted = this.defaultCandidateIndex
|
||||||
this.$refs.screenReaderNotice.announce(
|
this.$refs.screenReaderNotice.announce(
|
||||||
this.$tc('tool_tip.autocomplete_available',
|
this.$tc('tool_tip.autocomplete_available',
|
||||||
this.suggestions.length,
|
this.suggestions.length,
|
||||||
|
@ -501,6 +501,14 @@
|
|||||||
{{ $t('settings.pad_emoji') }}
|
{{ $t('settings.pad_emoji') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting
|
||||||
|
path="autocompleteSelect"
|
||||||
|
expert="1"
|
||||||
|
>
|
||||||
|
{{ $t('settings.autocomplete_select_first') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -465,6 +465,7 @@
|
|||||||
"domain_mutes": "Domains",
|
"domain_mutes": "Domains",
|
||||||
"avatar_size_instruction": "The recommended minimum size for avatar images is 150x150 pixels.",
|
"avatar_size_instruction": "The recommended minimum size for avatar images is 150x150 pixels.",
|
||||||
"pad_emoji": "Pad emoji with spaces when adding from picker",
|
"pad_emoji": "Pad emoji with spaces when adding from picker",
|
||||||
|
"autocomplete_select_first": "Automatically select the first candidate when autocomplete results are available",
|
||||||
"emoji_reactions_on_timeline": "Show emoji reactions on timeline",
|
"emoji_reactions_on_timeline": "Show emoji reactions on timeline",
|
||||||
"export_theme": "Save preset",
|
"export_theme": "Save preset",
|
||||||
"filtering": "Filtering",
|
"filtering": "Filtering",
|
||||||
|
@ -115,7 +115,8 @@ export const defaultState = {
|
|||||||
conversationTreeAdvanced: undefined, // instance default
|
conversationTreeAdvanced: undefined, // instance default
|
||||||
conversationOtherRepliesButton: undefined, // instance default
|
conversationOtherRepliesButton: undefined, // instance default
|
||||||
conversationTreeFadeAncestors: undefined, // instance default
|
conversationTreeFadeAncestors: undefined, // instance default
|
||||||
maxDepthInThread: undefined // instance default
|
maxDepthInThread: undefined, // instance default
|
||||||
|
autocompleteSelect: undefined // instance default
|
||||||
}
|
}
|
||||||
|
|
||||||
// caching the instance default properties
|
// caching the instance default properties
|
||||||
|
@ -104,6 +104,7 @@ const defaultState = {
|
|||||||
conversationOtherRepliesButton: 'below',
|
conversationOtherRepliesButton: 'below',
|
||||||
conversationTreeFadeAncestors: false,
|
conversationTreeFadeAncestors: false,
|
||||||
maxDepthInThread: 6,
|
maxDepthInThread: 6,
|
||||||
|
autocompleteSelect: false,
|
||||||
|
|
||||||
// Nasty stuff
|
// Nasty stuff
|
||||||
customEmoji: [],
|
customEmoji: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user