File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/Umbraco.Web.UI.Client/src/packages
documents/documents/tree/tree-item Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,12 @@ export class UmbTreeItemChildrenManager<
188188 * @memberof UmbTreeItemChildrenManager
189189 */
190190 public async loadChildren ( ) : Promise < void > {
191+ const target = this . targetPagination . getBaseTarget ( ) ;
192+ /* If a new target is set we only want to reload children if the new target isn’t among the already loaded items. */
193+ if ( target && this . isChildLoaded ( target ) ) {
194+ return ;
195+ }
196+
191197 return this . #loadChildren( ) ;
192198 }
193199
@@ -244,7 +250,7 @@ export class UmbTreeItemChildrenManager<
244250 ? this . targetPagination . getNumberOfCurrentItemsBeforeBaseTarget ( )
245251 : this . #takeBeforeTarget !== undefined
246252 ? this . #takeBeforeTarget
247- : 5 ,
253+ : this . targetPagination . getTakeSize ( ) ,
248254 takeAfter : reload
249255 ? this . targetPagination . getNumberOfCurrentItemsAfterBaseTarget ( )
250256 : this . #takeAfterTarget !== undefined
Original file line number Diff line number Diff line change @@ -94,12 +94,6 @@ export class UmbTreeItemTargetExpansionManager<
9494 return ;
9595 }
9696
97- /* If a new target is set we only want to reload children if the new target isn’t among the already loaded items. */
98- const targetIsLoaded = this . #childrenManager. isChildLoaded ( target ) ;
99- if ( target && targetIsLoaded ) {
100- return ;
101- }
102-
10397 // If we already have children and the target didn't change then we don't have to load new children
10498 const isNewTarget = target !== currentBaseTarget ;
10599 if ( isExpanded && this . #childrenManager. hasLoadedChildren ( ) && ! isNewTarget ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export class UmbDocumentTreeItemContext extends UmbDefaultTreeItemContext<
4040 this . hasCollection ,
4141 ( hasCollection ) => {
4242 if ( hasCollection ) {
43- this . _treeItemChildrenManager . setTargetTakeSize ( 2 , 2 ) ;
43+ this . _treeItemChildrenManager . setTargetTakeSize ( 1 , 1 ) ;
4444
4545 this . observe (
4646 this . hasActiveDescendant ,
You can’t perform that action at this time.
0 commit comments