Merge pull request #3848 from matrix-org/travis/fix-cut

Remove all text when cutting in the composer
This commit is contained in:
Travis Ralston 2020-01-16 15:03:41 -07:00 committed by GitHub
commit 43f97af805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -210,8 +210,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") {
selection.deleteFromDocument();
range.replace([]);
// Remove the text, updating the model as appropriate
replaceRangeAndMoveCaret(range, []);
}
event.preventDefault();
}