From c31903d2815f4acc28114587c013665c594e19b3 Mon Sep 17 00:00:00 2001 From: Alexandra Betouni Date: Mon, 6 Mar 2023 18:09:10 +0200 Subject: [PATCH] [StatusChatInput]: fixed focus and reply component lost - Fixed reply message is gone when adding image - Fixed pressing up arrow key when editing loses the cursor Closes #9419 Closes #9139 --- ui/imports/shared/status/StatusChatInput.qml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 575a7ee486..185464ffe9 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -357,10 +357,6 @@ Rectangle { } else if (event.key === Qt.Key_Escape && control.isReply) { control.isReply = false event.accepted = true - } else if (event.key === Qt.Key_Up && messageInputField.length === 0) { - event.accepted = true - control.keyUpPress() - return } const symbolPressed = event.text.length > 0 && @@ -887,7 +883,6 @@ Rectangle { function showImageArea(imagePathsOrData) { isImage = true; - isReply = false; imageArea.imageSource = imagePathsOrData control.fileUrlsAndSources = imageArea.imageSource @@ -1245,6 +1240,18 @@ Rectangle { bottomPadding: 9 leftPadding: 0 padding: 0 + Keys.onUpPressed: { + if (isEdit) { + forceActiveFocus(); + } else { + if (messageInputField.length === 0) { + control.keyUpPress(); + } + } + if (emojiSuggestions.visible) { + emojiSuggestions.listView.decrementCurrentIndex(); + } + } Keys.onPressed: { keyEvent = event; onKeyPress(event)