From 95bb6f0d7666411b2951ac5ca6c992a44bc91ed3 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 27 Feb 2020 11:38:31 +0000 Subject: [PATCH] Ignore cursor jumping shortcuts with shift This tweaks the new cursor jumping shortcuts in the composer so that they only activate without shift. When shift _is_ pressed, you want to extend the selection instead of just moving. Fixes https://github.com/vector-im/riot-web/issues/12549 --- src/components/views/rooms/BasicMessageComposer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index e366a20326..53d78d7314 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -393,14 +393,14 @@ export default class BasicMessageEditor extends React.Component { this._insertText("\n"); handled = true; // 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, { index: 0, offset: 0, }); handled = true; // 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, { index: model.parts.length - 1, offset: model.parts[model.parts.length - 1].text.length,