mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 11:03:18 +03:00
Ensure a plaintext version of the composer ends up on the clipboard
Fixes https://github.com/vector-im/riot-web/issues/12018
This commit is contained in:
parent
d899dcc2ee
commit
6adfa35445
1 changed files with 1 additions and 0 deletions
|
@ -208,6 +208,7 @@ export default class BasicMessageEditor extends React.Component {
|
||||||
const range = getRangeForSelection(this._editorRef, model, selection);
|
const range = getRangeForSelection(this._editorRef, model, selection);
|
||||||
const selectedParts = range.parts.map(p => p.serialize());
|
const selectedParts = range.parts.map(p => p.serialize());
|
||||||
event.clipboardData.setData("application/x-riot-composer", JSON.stringify(selectedParts));
|
event.clipboardData.setData("application/x-riot-composer", JSON.stringify(selectedParts));
|
||||||
|
event.clipboardData.setData("text/plain", text); // so plain copy/paste works
|
||||||
if (type === "cut") {
|
if (type === "cut") {
|
||||||
// Remove the text, updating the model as appropriate
|
// Remove the text, updating the model as appropriate
|
||||||
this._modifiedFlag = true;
|
this._modifiedFlag = true;
|
||||||
|
|
Loading…
Reference in a new issue