From 52ed55d887bacbbaf7f3117ce7ea4c2fc4cac18a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 30 Jan 2020 00:23:19 +0000 Subject: [PATCH] Update placeholder when it changes, not sure how this ever worked Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/BasicMessageComposer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index d2b6f8cbc8..a2a01f4444 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -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);