mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-07 15:08:24 +00:00
let onChange set originalEditorState
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user