diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 651974a408..be6fbee4f6 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -257,6 +257,8 @@ export default class MessageComposer extends React.Component { } onInputStateChanged(inputState) { + // Merge the new input state with old to support partial updates + inputState = Object.assign({}, this.state.inputState, inputState); this.setState({inputState}); } diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 1514b58e27..d55544293b 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -628,7 +628,6 @@ export default class MessageComposerInput extends React.Component { } const inputState = { marks: editorState.activeMarks, - isRichTextEnabled: this.state.isRichTextEnabled, blockType, }; this.props.onInputStateChanged(inputState); @@ -698,8 +697,13 @@ export default class MessageComposerInput extends React.Component { this.setState({ editorState: this.createEditorState(enabled, editorState), isRichTextEnabled: enabled, - }, ()=>{ + }, () => { this._editor.focus(); + if (this.props.onInputStateChanged) { + this.props.onInputStateChanged({ + isRichTextEnabled: enabled, + }); + } }); SettingsStore.setValue("MessageComposerInput.isRichTextEnabled", null, SettingLevel.ACCOUNT, enabled);