[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
This commit is contained in:
Alexandra Betouni 2023-03-06 18:09:10 +02:00 committed by Alexandra Betouni
parent 2fb158b810
commit c31903d281
1 changed files with 12 additions and 5 deletions

View File

@ -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)