@@ -72,6 +72,7 @@ ScopeView {
72 property string expandedCategoryId: ""
72 property string expandedCategoryId: ""
74 delegate: ListItems.Base {
74 delegate: ListItems.Base {
75 highlightWhenPressed: false
76 highlightWhenPressed: false
77 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
78 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
@@ -108,6 +109,7 @@ ScopeView {
108 item.filter = shouldFilter;
109 item.filter = shouldFilter;
112+ updateDelegateCreationRange();
113 Component.onDestruction: {
115 Component.onDestruction: {
@@ -164,6 +166,33 @@ ScopeView {
169+ onContentYChanged: rendererLoader.updateDelegateCreationRange();
170+ onHeightChanged: rendererLoader.updateDelegateCreationRange();
173+ function updateDelegateCreationRange() {
174+ // Do not update the range if we are overshooting up or down, since we'll come back
175+ // to the stable position and delete/create items without any reason
176+ if (categoryView.contentY < categoryView.originY) {
178+ } else if (categoryView.contentY + categoryView.height > categoryView.contentHeight) {
182+ if (item.hasOwnProperty("delegateCreationBegin")) {
183+ if (baseItem.y + baseItem.height <= 0) {
184+ // Not visible (item at top of the list)
185+ item.delegateCreationBegin = baseItem.height
186+ item.delegateCreationEnd = baseItem.height
187+ } else if (baseItem.y >= categoryView.height) {
188+ // Not visible (item at bottom of the list)
189+ item.delegateCreationBegin = 0
190+ item.delegateCreationEnd = 0
192+ item.delegateCreationBegin = Math.max(-baseItem.y, 0)
193+ item.delegateCreationEnd = Math.min(categoryView.height + item.delegateCreationBegin, baseItem.height)