fix(chat/textInput): prevent break mentions when ctrl+left is pressed
Closes #4981
This commit is contained in:
parent
5937c7d3aa
commit
76123f3b14
|
@ -976,12 +976,16 @@ Rectangle {
|
|||
messageInputField.remove(mentionsPos[i].rightIndex, mentionsPos[i].leftIndex);
|
||||
mentionsPos.pop(i);
|
||||
}
|
||||
}
|
||||
if ((keyEvent.key === Qt.Key_Up) || (keyEvent.key === Qt.Key_Down)) {
|
||||
} else if (((messageInputField.cursorPosition > mentionsPos[i].leftIndex) &&
|
||||
(messageInputField.cursorPosition < mentionsPos[i].rightIndex)) &&
|
||||
((keyEvent.key === Qt.Key_Left) && ((keyEvent.modifiers & Qt.AltModifier) ||
|
||||
(keyEvent.modifiers & Qt.ControlModifier)))) {
|
||||
messageInputField.cursorPosition = mentionsPos[i].leftIndex;
|
||||
} else if ((keyEvent.key === Qt.Key_Up) || (keyEvent.key === Qt.Key_Down)) {
|
||||
if (messageInputField.cursorPosition >= mentionsPos[i].leftIndex &&
|
||||
messageInputField.cursorPosition <= (((mentionsPos[i].leftIndex + mentionsPos[i].rightIndex)/2))) {
|
||||
messageInputField.cursorPosition = mentionsPos[i].leftIndex;
|
||||
} else if (messageInputField.cursorPosition <= mentionsPos[i].rightIndex &&
|
||||
} else if (messageInputField.cursorPosition <= mentionsPos[i].rightIndex &&
|
||||
messageInputField.cursorPosition > (((mentionsPos[i].leftIndex + mentionsPos[i].rightIndex)/2))) {
|
||||
messageInputField.cursorPosition = mentionsPos[i].rightIndex;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue