Merge pull request #3923 from matrix-org/travis/fix-copy-release

Ensure a plaintext version of the composer ends up on the clipboard
pull/21833/head
Travis Ralston 2020-01-23 16:02:49 -07:00 committed by GitHub
commit dbcfa86d7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -208,6 +208,7 @@ export default class BasicMessageEditor extends React.Component {
const range = getRangeForSelection(this._editorRef, model, selection);
const selectedParts = range.parts.map(p => p.serialize());
event.clipboardData.setData("application/x-riot-composer", JSON.stringify(selectedParts));
event.clipboardData.setData("text/plain", text); // so plain copy/paste works
if (type === "cut") {
// Remove the text, updating the model as appropriate
this._modifiedFlag = true;