Fix Inline Edit Focus
Make sure that the inline edit component get focus when an edit is started and the cursor is at the end
This commit is contained in:
@@ -24,12 +24,6 @@ QQC2.TextArea {
|
|||||||
verticalAlignment: TextEdit.AlignVCenter
|
verticalAlignment: TextEdit.AlignVCenter
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
forceActiveFocus();
|
|
||||||
root.cursorPosition = root.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
room.editText = text
|
room.editText = text
|
||||||
}
|
}
|
||||||
@@ -141,6 +135,8 @@ QQC2.TextArea {
|
|||||||
function updateEditText() {
|
function updateEditText() {
|
||||||
if (room.chatBoxEditId == messageId && room.chatBoxEditMessage.length > 0) {
|
if (room.chatBoxEditId == messageId && room.chatBoxEditMessage.length > 0) {
|
||||||
root.text = room.chatBoxEditMessage
|
root.text = room.chatBoxEditMessage
|
||||||
|
forceActiveFocus();
|
||||||
|
root.cursorPosition = root.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user