Merge pull request #4265 from ThobyV/thobyv/hide-formatbar-onEnter-highlighted-message

Fix formatbar not hidden on highlighted message sent
pull/21833/head
Bruno Windels 2020-03-25 09:01:36 +00:00 committed by GitHub
commit 8521ed1a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -149,14 +149,17 @@ export default class BasicMessageEditor extends React.Component {
const position = selection.end || selection; const position = selection.end || selection;
this._setLastCaretFromPosition(position); this._setLastCaretFromPosition(position);
} }
const {isEmpty} = this.props.model;
if (this.props.placeholder) { if (this.props.placeholder) {
const {isEmpty} = this.props.model;
if (isEmpty) { if (isEmpty) {
this._showPlaceholder(); this._showPlaceholder();
} else { } else {
this._hidePlaceholder(); this._hidePlaceholder();
} }
} }
if (isEmpty) {
this._formatBarRef.hide();
}
this.setState({autoComplete: this.props.model.autoComplete}); this.setState({autoComplete: this.props.model.autoComplete});
this.historyManager.tryPush(this.props.model, selection, inputType, diff); this.historyManager.tryPush(this.props.model, selection, inputType, diff);
TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, !this.props.model.isEmpty); TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, !this.props.model.isEmpty);