Browse Source

Fix weird update jitter in objectSelector after multiplying models

Jaime van Kessel 5 years ago
parent
commit
678621469f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      resources/qml/ObjectSelector.qml

+ 6 - 1
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: