Merge pull request #4142 from matrix-org/jryans/shift-composer-shortcut

Ignore cursor jumping shortcuts with shift
This commit is contained in:
J. Ryan Stinnett 2020-02-27 16:09:20 +00:00 committed by GitHub
commit 5325b5677f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -393,14 +393,14 @@ export default class BasicMessageEditor extends React.Component {
this._insertText("\n"); this._insertText("\n");
handled = true; handled = true;
// move selection to start of composer // move selection to start of composer
} else if (modKey && event.key === Key.HOME) { } else if (modKey && event.key === Key.HOME && !event.shiftKey) {
setSelection(this._editorRef, model, { setSelection(this._editorRef, model, {
index: 0, index: 0,
offset: 0, offset: 0,
}); });
handled = true; handled = true;
// move selection to end of composer // move selection to end of composer
} else if (modKey && event.key === Key.END) { } else if (modKey && event.key === Key.END && !event.shiftKey) {
setSelection(this._editorRef, model, { setSelection(this._editorRef, model, {
index: model.parts.length - 1, index: model.parts.length - 1,
offset: model.parts[model.parts.length - 1].text.length, offset: model.parts[model.parts.length - 1].text.length,