sstur / react-rte

Pure React rich text WYSIWYG editor based on draft-js.
https://react-rte.org
ISC License
2.86k stars 430 forks source link

Freezes with large paste from cliboard #368

Open mikeck1 opened 4 years ago

mikeck1 commented 4 years ago
import RichTextEditor from 'react-rte';
...
const [editorValue, setEditorValue] =
        React.useState(RichTextEditor.createValueFromString(localPost.body, 'html'));
...

const handleChange = value => {
        setEditorValue(value);
        setPost(value.toString("html"));
        console.log(value._cache.html)
        _updateLocalPost({ ...localPost, body: value._cache.html })
    };

<RichTextEditor
                                            value={editorValue}
                                            onChange={handleChange}
                                            required
                                            id="body-text"
                                            name="bodyText"
                                            type="string"
                                            multiline
                                            variant="filled"
                                            style={{ minHeight: 410 }}
                                        />

"react-rte": "^0.16.1",

When I try to paste over 30+ lines of code into the text window it will lag like crazy, or freeze. Anyone else have this problem?