From 1c443c835231194ab9536b13d18f4ff00ea5dba8 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Wed, 27 Jun 2018 16:27:53 +0200 Subject: [PATCH] MOBILE-2452 course: Scroll back after completing an activity --- src/core/course/pages/section/section.html | 2 +- src/core/course/pages/section/section.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/course/pages/section/section.html b/src/core/course/pages/section/section.html index 63a0a5553..6c2eac5a3 100644 --- a/src/core/course/pages/section/section.html +++ b/src/core/course/pages/section/section.html @@ -17,7 +17,7 @@ - + diff --git a/src/core/course/pages/section/section.ts b/src/core/course/pages/section/section.ts index 9c3bb2e47..c3ec8e779 100644 --- a/src/core/course/pages/section/section.ts +++ b/src/core/course/pages/section/section.ts @@ -37,7 +37,7 @@ import { CoreTabsComponent } from '@components/tabs/tabs'; templateUrl: 'section.html', }) export class CoreCourseSectionPage implements OnDestroy { - @ViewChild(Content) content: Content; + @ViewChild('courseSectionContent') content: Content; @ViewChild(CoreCourseFormatComponent) formatComponent: CoreCourseFormatComponent; @ViewChild(CoreTabsComponent) tabsComponent: CoreTabsComponent; @@ -303,7 +303,11 @@ export class CoreCourseSectionPage implements OnDestroy { this.loadData().finally(() => { this.dataLoaded = true; - this.content.scrollTo(scrollLeft, scrollTop); + + // Wait for new content height to be calculated and scroll without animation. + setTimeout(() => { + this.content.scrollTo(scrollLeft, scrollTop, 0); + }); }); }