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:
James Graham
2023-02-25 16:30:17 +00:00
parent 8825e6ec83
commit 71c9537c61

View File

@@ -24,12 +24,6 @@ QQC2.TextArea {
verticalAlignment: TextEdit.AlignVCenter
wrapMode: Text.Wrap
onVisibleChanged: {
if (visible) {
forceActiveFocus();
root.cursorPosition = root.length;
}
}
onTextChanged: {
room.editText = text
}
@@ -141,6 +135,8 @@ QQC2.TextArea {
function updateEditText() {
if (room.chatBoxEditId == messageId && room.chatBoxEditMessage.length > 0) {
root.text = room.chatBoxEditMessage
forceActiveFocus();
root.cursorPosition = root.length;
}
}
}