Hide empty autocomplete and remove word counter
This commit is contained in:
parent
802ec1169f
commit
8974442084
3 changed files with 3 additions and 5 deletions
|
@ -149,13 +149,13 @@ export default class Autocomplete extends React.Component {
|
||||||
{completionResult.provider.renderCompletions(completions)}
|
{completionResult.provider.renderCompletions(completions)}
|
||||||
</div>
|
</div>
|
||||||
) : null;
|
) : null;
|
||||||
});
|
}).filter(completion => !!completion);
|
||||||
|
|
||||||
return (
|
return renderedCompletions.length > 0 ? (
|
||||||
<div className="mx_Autocomplete" ref={(e) => this.container = e}>
|
<div className="mx_Autocomplete" ref={(e) => this.container = e}>
|
||||||
{renderedCompletions}
|
{renderedCompletions}
|
||||||
</div>
|
</div>
|
||||||
);
|
) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -318,7 +318,6 @@ export default class MessageComposer extends React.Component {
|
||||||
<div className="mx_MessageComposer_formatbar" style={this.state.showFormatting ? {} : {display: 'none'}}>
|
<div className="mx_MessageComposer_formatbar" style={this.state.showFormatting ? {} : {display: 'none'}}>
|
||||||
{formatButtons}
|
{formatButtons}
|
||||||
<div style={{flex: 1}}></div>
|
<div style={{flex: 1}}></div>
|
||||||
<strong>{this.state.inputState.wordCount}</strong>
|
|
||||||
<img title={`Turn Markdown ${this.state.inputState.isRichtextEnabled ? 'on' : 'off'}`}
|
<img title={`Turn Markdown ${this.state.inputState.isRichtextEnabled ? 'on' : 'off'}`}
|
||||||
onClick={this.onToggleMarkdownClicked}
|
onClick={this.onToggleMarkdownClicked}
|
||||||
className="mx_MessageComposer_formatbar_markdown"
|
className="mx_MessageComposer_formatbar_markdown"
|
||||||
|
|
|
@ -241,7 +241,6 @@ export default class MessageComposerInput extends React.Component {
|
||||||
if (this.props.onInputStateChanged && nextState !== this.state) {
|
if (this.props.onInputStateChanged && nextState !== this.state) {
|
||||||
const state = this.getSelectionInfo(nextState.editorState);
|
const state = this.getSelectionInfo(nextState.editorState);
|
||||||
state.isRichtextEnabled = nextState.isRichtextEnabled;
|
state.isRichtextEnabled = nextState.isRichtextEnabled;
|
||||||
state.wordCount = nextState.editorState.getCurrentContent().getPlainText().split(' ').filter(w => !!w).length;
|
|
||||||
this.props.onInputStateChanged(state);
|
this.props.onInputStateChanged(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue