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