diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 4d00927767..28502c348d 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -354,7 +354,7 @@ export default class MessageComposer extends React.Component { } let formatBar; - if (this.state.showFormatting) { + if (this.state.showFormatting && this.state.inputState.isRichTextEnabled) { const {marks, blockType} = this.state.inputState; const formatButtons = ["bold", "italic", "deleted", "underlined", "code", "block-quote", "bulleted-list", "numbered-list"].map( (name) => { diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 2d5e6d050d..2bb35c5656 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -1405,9 +1405,7 @@ export default class MessageComposerInput extends React.Component { }; onFormatButtonClicked = (name, e) => { - if (e) { - e.preventDefault(); // don't steal focus from the editor! - } + e.preventDefault(); // don't steal focus from the editor! // XXX: horrible evil hack to ensure the editor is focused so the act // of focusing it doesn't then cancel the format button being pressed