From e57f0690def94de1142ade4fb86361cb3e3e7698 Mon Sep 17 00:00:00 2001 From: DavidLazarescu Date: Wed, 18 Oct 2023 11:16:50 +0200 Subject: [PATCH] Fixed renaming issues --- src/presentation/readingPage/MBookmarkItem.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/presentation/readingPage/MBookmarkItem.qml b/src/presentation/readingPage/MBookmarkItem.qml index 5f183b1dc..57fe83b8d 100644 --- a/src/presentation/readingPage/MBookmarkItem.qml +++ b/src/presentation/readingPage/MBookmarkItem.qml @@ -16,11 +16,22 @@ Rectangle { Component.onCompleted: { if (bookmarksView.lastAddedUuid === model.uuid) { - startRenaming() bookmarksView.lastAddedUuid = "" + renamingStartTimer.start() } } + // For some reason qml sometimes forces the active focus to another item right + // after Component.onCompleted, which cancels the renaming. Using a timer with a + // minimal rename to trigger the start of the renaming fixes it. + Timer { + id: renamingStartTimer + interval: 10 + repeat: false + + onTriggered: startRenaming() + } + RowLayout { id: layout anchors.fill: parent