[MM-29275]: Remove first char of slash cmd autocomplete suggestion text, only if it is a top-level command (#4868) (#4873)
* Remove first char of suggestion text, only if it is a slash
* Check if suggestion is for a top-level command
(cherry picked from commit a6779f4293)
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
This commit is contained in:
parent
a3dae17ded
commit
c9ce2338f8
1 changed files with 7 additions and 1 deletions
|
|
@ -32,11 +32,17 @@ export default class SlashSuggestionItem extends PureComponent {
|
|||
hint,
|
||||
theme,
|
||||
suggestion,
|
||||
complete,
|
||||
isLandscape,
|
||||
} = this.props;
|
||||
|
||||
const style = getStyleFromTheme(theme);
|
||||
|
||||
let suggestionText = suggestion;
|
||||
if (suggestionText[0] === '/' && complete.split(' ').length === 1) {
|
||||
suggestionText = suggestionText.substring(1);
|
||||
}
|
||||
|
||||
return (
|
||||
<TouchableWithFeedback
|
||||
onPress={this.completeSuggestion}
|
||||
|
|
@ -54,7 +60,7 @@ export default class SlashSuggestionItem extends PureComponent {
|
|||
/>
|
||||
</View>
|
||||
<View style={style.suggestionContainer}>
|
||||
<Text style={style.suggestionName}>{`${suggestion.substring(1)} ${hint}`}</Text>
|
||||
<Text style={style.suggestionName}>{`${suggestionText} ${hint}`}</Text>
|
||||
<Text
|
||||
ellipsizeMode='tail'
|
||||
numberOfLines={1}
|
||||
|
|
|
|||
Loading…
Reference in a new issue