From fd49ee705791f2bc4e062fe64a29ab78c20c431a Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 6 Jul 2021 10:57:33 +0200 Subject: [PATCH] MOBILE-3320 database: Fix advanced search entries --- src/addons/mod/data/components/index/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/addons/mod/data/components/index/index.ts b/src/addons/mod/data/components/index/index.ts index c99612586..adec614b3 100644 --- a/src/addons/mod/data/components/index/index.ts +++ b/src/addons/mod/data/components/index/index.ts @@ -498,9 +498,11 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp }; // Try to find page number and offset of the entry. - const pageXOffset = this.entries.findIndex((entry) => entry.id == entryId); - if (pageXOffset >= 0) { - params.offset = this.search.page * AddonModDataProvider.PER_PAGE + pageXOffset; + if (!this.search.searching) { + const pageXOffset = this.entries.findIndex((entry) => entry.id == entryId); + if (pageXOffset >= 0) { + params.offset = this.search.page * AddonModDataProvider.PER_PAGE + pageXOffset; + } } CoreNavigator.navigateToSitePath(