Merge pull request #3667 from NoelDeMartin/MOBILE-4270

MOBILE-4270 core: Fix list items auto-scroll
main
Alfonso Salces 2023-05-10 13:32:34 +02:00 committed by GitHub
commit b3b269c8d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,10 @@ export class CoreListItemsManager<
constructor(source: Source, pageRouteLocator: unknown | ActivatedRoute) {
super(source);
const debouncedScrollToCurrentElement = CoreUtils.debounce(() => this.scrollToCurrentElement(), 300);
this.pageRouteLocator = pageRouteLocator;
this.addListener({ onSelectedItemUpdated: debouncedScrollToCurrentElement });
}
get items(): Item[] {
@ -130,7 +133,6 @@ export class CoreListItemsManager<
}
await this.navigateToItem(item, { reset: this.resetNavigation() });
setTimeout(async () => await this.scrollToCurrentElement(), 100);
}
/**