From dfd0516399d49ef6e136a892f4e3aad62b6a060d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2017 10:50:53 +0100 Subject: [PATCH] fix(ui/modules/Common/Form/ListForm): add same magic code at a lower depth... --- linphone-desktop/ui/modules/Common/Form/ListForm.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/linphone-desktop/ui/modules/Common/Form/ListForm.qml b/linphone-desktop/ui/modules/Common/Form/ListForm.qml index e86652eeb..c8d95dcbd 100644 --- a/linphone-desktop/ui/modules/Common/Form/ListForm.qml +++ b/linphone-desktop/ui/modules/Common/Form/ListForm.qml @@ -176,7 +176,17 @@ RowLayout { Component.onCompleted: { if ($value.length === 0) { - textInput.forceActiveFocus() + // FIXME: Find the source of this problem. + // + // Magic code. If it's the first inserted value, + // an event or a callback steal the item focus. + // I suppose it's an internal Qt qml event... + // + // So, I choose to run a callback executed after this + // internal event. + Utils.setTimeout(listForm, 0, function () { + textInput.forceActiveFocus() + }) } } }