MOBILE-3738 navigation: Fix nested split-views

main
Noel De Martin 2021-04-29 16:14:59 +02:00
parent 21ccad82f0
commit 6d9cc0e235
1 changed files with 15 additions and 4 deletions

View File

@ -154,12 +154,10 @@ export abstract class CorePageItemsListManager<Item> {
// Navigate to item.
const params = this.getItemQueryParams(item);
const reset = this.resetNavigation();
const pathPrefix = selectedItemPath ? selectedItemPath.split('/').fill('../').join('') : '';
await CoreNavigator.navigate(pathPrefix + itemPath, {
params,
reset: CoreScreen.isTablet,
});
await CoreNavigator.navigate(pathPrefix + itemPath, { params, reset });
}
/**
@ -200,6 +198,19 @@ export abstract class CorePageItemsListManager<Item> {
: null;
}
/**
* Check whether to reset navigation when selecting an item.
*
* @returns boolean Whether navigation should be reset.
*/
protected resetNavigation(): boolean {
if (!CoreScreen.isTablet) {
return false;
}
return !this.splitView?.isNested;
}
/**
* Get the item that should be selected by default.
*/