From d03e964ed77a980b027e53f5d6534625a9a8218b Mon Sep 17 00:00:00 2001 From: Ryan Frew Date: Fri, 28 Jun 2024 10:07:46 +1200 Subject: [PATCH] Corrected newline inserting when using shift+return while writing SMS messages Shift+return was always inserting newline at the end of the current line of text, ignoring where the cursor was, and not overriding currently selected text BUG: 488585 --- smsapp/qml/SendingArea.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/smsapp/qml/SendingArea.qml b/smsapp/qml/SendingArea.qml index a7cbea0fc..f1bbff418 100644 --- a/smsapp/qml/SendingArea.qml +++ b/smsapp/qml/SendingArea.qml @@ -84,7 +84,9 @@ ColumnLayout { Keys.onReturnPressed: event => { if (event.key === Qt.Key_Return) { if (event.modifiers & Qt.ShiftModifier) { - messageField.append("") + //remove any selected text and insert new line at cursor position + messageField.cursorSelection.text = "" + messageField.insert(messageField.cursorPosition,"\n") } else { sendButton.clicked() event.accepted = true