You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03: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