refactor:consider checking if no placeholder
This commit is contained in:
parent
d7953dfa6d
commit
91b9a04ede
1 changed files with 4 additions and 2 deletions
|
@ -149,15 +149,17 @@ export default class BasicMessageEditor extends React.Component {
|
|||
const position = selection.end || selection;
|
||||
this._setLastCaretFromPosition(position);
|
||||
}
|
||||
const {isEmpty} = this.props.model;
|
||||
if (this.props.placeholder) {
|
||||
const {isEmpty} = this.props.model;
|
||||
if (isEmpty) {
|
||||
this._formatBarRef.hide();
|
||||
this._showPlaceholder();
|
||||
} else {
|
||||
this._hidePlaceholder();
|
||||
}
|
||||
}
|
||||
if(isEmpty) {
|
||||
this._formatBarRef.hide();
|
||||
}
|
||||
this.setState({autoComplete: this.props.model.autoComplete});
|
||||
this.historyManager.tryPush(this.props.model, selection, inputType, diff);
|
||||
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, !this.props.model.isEmpty);
|
||||
|
|
Loading…
Reference in a new issue