From 241049e93b8911136779ce9fad0605be7ab33581 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2017 10:43:34 +0100 Subject: [PATCH] fix(ui/modules/Common/Form/ListForm): remove "magic code" --- .../ui/modules/Common/Form/ListForm.qml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/linphone-desktop/ui/modules/Common/Form/ListForm.qml b/linphone-desktop/ui/modules/Common/Form/ListForm.qml index f68ba8190..e86652eeb 100644 --- a/linphone-desktop/ui/modules/Common/Form/ListForm.qml +++ b/linphone-desktop/ui/modules/Common/Form/ListForm.qml @@ -173,19 +173,11 @@ RowLayout { width: parent.width onEditingFinished: _handleEditionFinished(index, text) - } - Component.onCompleted: { - if ($value.length === 0) { - // 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 () { + Component.onCompleted: { + if ($value.length === 0) { textInput.forceActiveFocus() - }) + } } } }