You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-14 19:02:33 +03:00
refactor:consider checking if no placeholder
This commit is contained in:
@@ -149,15 +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._formatBarRef.hide();
|
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user