From 71c9537c61059e78c15b36cde793ca787010a5fd Mon Sep 17 00:00:00 2001 From: James Graham Date: Sat, 25 Feb 2023 16:30:17 +0000 Subject: [PATCH] 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 --- src/qml/Component/Timeline/MessageEditComponent.qml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qml/Component/Timeline/MessageEditComponent.qml b/src/qml/Component/Timeline/MessageEditComponent.qml index c76b5d0b2..e2678a79e 100644 --- a/src/qml/Component/Timeline/MessageEditComponent.qml +++ b/src/qml/Component/Timeline/MessageEditComponent.qml @@ -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; } } }