Replace the selected range instead of force-setting it
This gives people the option of cutting parts or all of their message.pull/21833/head
parent
be3ef2b50e
commit
b137cd21d3
|
@ -209,9 +209,8 @@ export default class BasicMessageEditor extends React.Component {
|
|||
const selectedParts = range.parts.map(p => p.serialize());
|
||||
event.clipboardData.setData("application/x-riot-composer", JSON.stringify(selectedParts));
|
||||
if (type === "cut") {
|
||||
// Remove the text from the composer
|
||||
const {caret} = getCaretOffsetAndText(this._editorRef, selection);
|
||||
this.props.model.update("", event.inputType, caret);
|
||||
// Remove the text, updating the model as appropriate
|
||||
replaceRangeAndMoveCaret(range, []);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue