Update placeholder when it changes, not sure how this ever worked

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-01-30 00:23:19 +00:00
parent 1475f5c73a
commit 52ed55d887

View file

@ -94,6 +94,17 @@ export default class BasicMessageEditor extends React.Component {
this._emoticonSettingHandle = null;
}
componentDidUpdate(prevProps) {
if (this.props.placeholder !== prevProps.placeholder && this.props.placeholder) {
const {isEmpty} = this.props.model;
if (isEmpty) {
this._showPlaceholder();
} else {
this._hidePlaceholder();
}
}
}
_replaceEmoticon = (caretPosition, inputType, diff) => {
const {model} = this.props;
const range = model.startRange(caretPosition);