[MM-29275]: Remove first char of slash cmd autocomplete suggestion text, only if it is a top-level command (#4868)
* Remove first char of suggestion text, only if it is a slash * Check if suggestion is for a top-level command
This commit is contained in:
parent
40b650bcd9
commit
a6779f4293
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