From d7953dfa6dfc18ce0161ab8cf1a46359bab83068 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Tue, 24 Mar 2020 13:09:06 +0100 Subject: [PATCH 1/3] fix formatbar not hidden on highlighted message sent --- src/components/views/rooms/BasicMessageComposer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 147f3c0af8..899b3360d8 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -152,6 +152,7 @@ export default class BasicMessageEditor extends React.Component { if (this.props.placeholder) { const {isEmpty} = this.props.model; if (isEmpty) { + this._formatBarRef.hide(); this._showPlaceholder(); } else { this._hidePlaceholder(); From 91b9a04ede6ebb18bd6a53e756a1f2f6a24399d4 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Tue, 24 Mar 2020 19:00:43 +0100 Subject: [PATCH 2/3] refactor:consider checking if no placeholder --- src/components/views/rooms/BasicMessageComposer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 899b3360d8..707dc12a97 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -149,15 +149,17 @@ export default class BasicMessageEditor extends React.Component { const position = selection.end || selection; this._setLastCaretFromPosition(position); } + const {isEmpty} = this.props.model; if (this.props.placeholder) { - const {isEmpty} = this.props.model; if (isEmpty) { - this._formatBarRef.hide(); this._showPlaceholder(); } else { this._hidePlaceholder(); } } + if(isEmpty) { + this._formatBarRef.hide(); + } this.setState({autoComplete: this.props.model.autoComplete}); this.historyManager.tryPush(this.props.model, selection, inputType, diff); TypingStore.sharedInstance().setSelfTyping(this.props.room.roomId, !this.props.model.isEmpty); From b817c06c6e6259b0f23c21c1329a061490ae3c10 Mon Sep 17 00:00:00 2001 From: thobyv-kismat Date: Tue, 24 Mar 2020 19:09:50 +0100 Subject: [PATCH 3/3] fix failing linter tests --- src/components/views/rooms/BasicMessageComposer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index 707dc12a97..75455518a1 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -157,7 +157,7 @@ export default class BasicMessageEditor extends React.Component { this._hidePlaceholder(); } } - if(isEmpty) { + if (isEmpty) { this._formatBarRef.hide(); } this.setState({autoComplete: this.props.model.autoComplete});