| Summary: | Shift-Return in KDE Connect SMS inserts newline at the end of field, not at cursor location | ||
|---|---|---|---|
| Product: | [Applications] kdeconnect | Reporter: | Jiří Wolker <kde-devel> |
| Component: | messaging-application | Assignee: | Simon Redman <simon> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kde-devel |
| Priority: | NOR | Keywords: | junior-jobs |
| Version First Reported In: | 24.05.1 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/network/kdeconnect-kde/-/commit/d03e964ed77a980b027e53f5d6534625a9a8218b | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Jiří Wolker
2024-06-16 15:36:41 UTC
Confirmed this behavior. Thanks for the report.
This is pretty clear looking at the code in smsapp/qml/SendingArea.qml, line 84 on, that it appends the newline to the text entry field:
Keys.onReturnPressed: event => {
if (event.key === Qt.Key_Return) {
if (event.modifiers & Qt.ShiftModifier) {
messageField.append("")
} else {
sendButton.clicked()
event.accepted = true
}
}
}
I can't think of a way to improve this code off-hand. Tagging this as a junior job since it's probably a simple change, just needs someone to spend a little time researching the right solution and test it.
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/695 Git commit d03e964ed77a980b027e53f5d6534625a9a8218b by Albert Vaca Cintora, on behalf of Ryan Frew. Committed on 28/06/2024 at 11:19. Pushed by albertvaka into branch 'master'. 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 M +3 -1 smsapp/qml/SendingArea.qml https://invent.kde.org/network/kdeconnect-kde/-/commit/d03e964ed77a980b027e53f5d6534625a9a8218b |