-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't paste entites into RTE when RT mode enabled #4962
Comments
Here is the error that shows in debugger after failed paste:
|
And here is from unminified Develop web version:
|
@MurzNN thanks for that second trace, should be useful for finding the bug. |
It reproducible fails when I want to paste a message which contains emoji's while Markdown is disabled. This is my stacktrace:
|
OK, so this happens when copying links as well as emoji, so things go wrong with new entities basically. A more salient, filtered stack trace: bundle.js:1422 Uncaught Error: Unknown DraftEntity Key.
at ContentState.getEntity (https://riot.im/develop/bundles/da5e4e753da6e83256f5/bundle.js:54684:51)
...
at findRangesImmutable (https://riot.im/develop/bundles/da5e4e753da6e83256f5/bundle.js:37547:13)
...
at ContentBlock.findEntityRanges (https://riot.im/develop/bundles/da5e4e753da6e83256f5/bundle.js:17953:6)
...
at MessageComposerInput.findPillEntities (https://riot.im/develop/bundles/da5e4e753da6e83256f5/bundle.js:148083:27)
...
at CompositeDraftDecorator.getDecorations (https://riot.im/develop/bundles/da5e4e753da6e83256f5/bundle.js:196682:23) |
So I think this is being caused by facebookarchive/draft-js#1363 and there's no real work-around. I tried removing entities from the pasted text after it was inserted but to no avail - there are still parts of draft-js that are becoming corrupt and causing this to be thrown. |
I just had this nastily when trying to paste HTML changelog entries from github.com/matrix-org/synapse/releases into RTE in non-MD mode :( |
|
Maybe this way facebookarchive/draft-js#1363 (comment) can fix issue? |
Looking at @ara4n's stack trace, this bug happens when we The issue facebookarchive/draft-js#1363 (comment) is regarding entity creation. |
fixed by matrix-org/matrix-react-sdk#1890 |
After update from 0.11.x to 0.12.2 on Riot Electron in Linux (Ubuntu & KDE 4.x) - sometimes we can't paste from clipboard to message textarea, this reproduced on several computers in our company.
I have clipboard content, press shift-insert or ctrl+v, middle mouse paste and nothing happens. Even when I have plaintext content. On other app this clipboard content pastes normally.
On 0.11.x versions there was be no problems like this. Seems that Riot try to parse clipboard content before insert and fail sometimes with this.
The text was updated successfully, but these errors were encountered: