From 3f842b84833421d4b45ba469ce4f673e664dfd88 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 3 Dec 2019 15:08:35 +0100 Subject: [PATCH] MOBILE-1501 participants: Select first when search or clear --- .../user/components/participants/participants.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/user/components/participants/participants.ts b/src/core/user/components/participants/participants.ts index 0ace51d8d..bcb4edce8 100644 --- a/src/core/user/components/participants/participants.ts +++ b/src/core/user/components/participants/participants.ts @@ -165,7 +165,12 @@ export class CoreUserParticipantsComponent implements OnInit { // Remove search results and display all participants. this.participantsLoaded = false; - this.fetchData(true); + this.fetchData(true).then(() => { + if (this.splitviewCtrl.isOn() && this.participants.length > 0) { + // Take first and load it. + this.gotoParticipant(this.participants[0].id); + } + }); } /** @@ -196,6 +201,11 @@ export class CoreUserParticipantsComponent implements OnInit { this.canLoadMore = result.canLoadMore; this.searchPage++; + if (!loadMore && this.splitviewCtrl.isOn() && this.participants.length > 0) { + // Take first and load it. + this.gotoParticipant(this.participants[0].id); + } + }).catch((error) => { this.domUtils.showErrorModalDefault(error, 'Error searching users.'); this.loadMoreError = true;