From 678621469f51ac6014378cfbe3d9f6590f6d25cf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 22 Jul 2019 10:31:21 +0200 Subject: [PATCH] Fix weird update jitter in objectSelector after multiplying models --- resources/qml/ObjectSelector.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index 26a63da71b..9bf0e18809 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -105,7 +105,12 @@ Item // We use an extra property here, since we only want to to be informed about the content size changes. onContentHeightChanged: { - scroll.height = Math.min(contentHeight, maximumHeight) + scroll.topPadding + scroll.bottomPadding + // It can sometimes happen that (due to animations / updates) the contentHeight is -1. + // This can cause a bunch of updates to trigger oneother, leading to a weird loop. + if(contentHeight >= 0) + { + scroll.height = Math.min(contentHeight, maximumHeight) + scroll.topPadding + scroll.bottomPadding + } } Component.onCompleted: