Skip to content

Commit

Permalink
[StatusChatInput]: fixed focus and reply component lost
Browse files Browse the repository at this point in the history
- Fixed reply message is gone when adding image
- Fixed pressing up arrow key when editing loses the cursor

Closes #9419
Closes #9139
  • Loading branch information
alexandraB99 committed Mar 9, 2023
1 parent 2fb158b commit c31903d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ui/imports/shared/status/StatusChatInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -887,7 +883,6 @@ Rectangle {

function showImageArea(imagePathsOrData) {
isImage = true;
isReply = false;

imageArea.imageSource = imagePathsOrData
control.fileUrlsAndSources = imageArea.imageSource
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c31903d

Please sign in to comment.