check out var o below:
before minified:
this.handlePastedText = function(t, n) {
if (e.props.handlePastedText && e.props.handlePastedText(t, n, o, e.onChange))
return !0;
var o = e.state.editorState;
return (0,
x.handlePastedText)(t, n, o, e.onChange)
}
after minified:
this.handlePastedText = function(t, n) {
return e.props.handlePastedText ? e.props.handlePastedText(t, n, editorState,
e.onChange) : !e.props.stripPastedStyles && (0,
O.handlePastedText)(t, n, e.state.editorState, e.onChange)
}
this leads to be unable pasting texts and a console error:
react.sns2_bundle.js:formatted:81317 Uncaught ReferenceError: editorState is not defined
at Object.Q.handlePastedText (react.sns2_bundle.js:formatted:81317)
at r (react.sns2_bundle.js:formatted:76245)
at react.sns2_bundle.js:formatted:74574
at Object.r (react.sns2_bundle.js:formatted:19538)
at a (react.sns2_bundle.js:formatted:19327)
at Object.s [as executeDispatchesInOrder] (react.sns2_bundle.js:formatted:19337)
at p (react.sns2_bundle.js:formatted:15367)
at m (react.sns2_bundle.js:formatted:15374)
at Array.forEach (<anonymous>)
at r (react.sns2_bundle.js:formatted:24598)
i wonder same error related to https://github.com/jpuri/react-draft-wysiwyg/issues/619
Same here.
Uncaught ReferenceError: editorState is not defined
at Object.J.handlePastedText (bundle.js?v=release-1.37.0:formatted:76224)
I solved. I created a pull request.
If you want to solve it by yourself, the bug is in Editor/index.js
Just move up editorState variable declaration, as @june50232 suggested.
In src/Editor/index.js handlePastedText function has to be like this:
handlePastedText = (text, html) => {
const { editorState } = this.state;
if (this.props.handlePastedText) {
return this.props.handlePastedText(
text,
html,
editorState,
this.onChange
);
}
if (!this.props.stripPastedStyles) {
return handlePastedText(text, html, editorState, this.onChange);
}
return false;
};
Or clone from here: https://github.com/Huespal/react-draft-wysiwyg. Without any guarantees. I will delete this fork when bug is solved in @jpuri repo.
Change has been released [email protected]. Thanks again 馃憤