mirror of
https://github.com/vector-im/element-web.git
synced 2025-09-03 12:51:04 +02:00
Merge pull request #3990 from matrix-org/t3chguy/fix_composer_placeholder
Update placeholder in the composer when it gets changed
This commit is contained in:
commit
9c8ffb6c4e
@ -94,6 +94,17 @@ export default class BasicMessageEditor extends React.Component {
|
|||||||
this._emoticonSettingHandle = null;
|
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) => {
|
_replaceEmoticon = (caretPosition, inputType, diff) => {
|
||||||
const {model} = this.props;
|
const {model} = this.props;
|
||||||
const range = model.startRange(caretPosition);
|
const range = model.startRange(caretPosition);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user