let onChange set originalEditorState

pull/21833/head
Matthew Hodgson 2018-05-15 01:16:06 +01:00
parent b60ccad29b
commit 4eb6942211
1 changed files with 3 additions and 7 deletions

View File

@ -346,7 +346,7 @@ export default class MessageComposerInput extends React.Component {
} }
} }
onChange = (change: Change) => { onChange = (change: Change, originalEditorState: value) => {
let editorState = change.value; let editorState = change.value;
@ -467,7 +467,7 @@ export default class MessageComposerInput extends React.Component {
/* Since a modification was made, set originalEditorState to null, since newState is now our original */ /* Since a modification was made, set originalEditorState to null, since newState is now our original */
this.setState({ this.setState({
editorState, editorState,
originalEditorState: null, originalEditorState: originalEditorState || null
}); });
}; };
@ -1050,11 +1050,7 @@ export default class MessageComposerInput extends React.Component {
} }
editorState = change.value; editorState = change.value;
this.onChange(change); this.onChange(change, activeEditorState);
this.setState({
originalEditorState: activeEditorState
});
return true; return true;
}; };