fix(vue): correct views are now unmounted in tabs (#25270)

resolves #25255
This commit is contained in:
Liam DeBeasi
2022-05-18 10:10:02 -04:00
committed by GitHub
parent ba0f8caba8
commit 5e23fb1ce4
3 changed files with 71 additions and 4 deletions

View File

@ -317,6 +317,8 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
leavingEl.classList.add('ion-page-hidden');
leavingEl.setAttribute('aria-hidden', 'true');
const usingLinearNavigation = viewStacks.size() === 1;
if (routerAction === 'replace') {
leavingViewItem.mount = false;
leavingViewItem.ionPageElement = undefined;
@ -327,9 +329,18 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
leavingViewItem.mount = false;
leavingViewItem.ionPageElement = undefined;
leavingViewItem.ionRoute = false;
viewStacks.unmountLeavingViews(id, enteringViewItem, delta);
/**
* router.go() expects navigation to be
* linear. If an app is using multiple stacks then
* it is not using linear navigation. As a result, router.go()
* will not give the results that developers are expecting.
*/
if (usingLinearNavigation) {
viewStacks.unmountLeavingViews(id, enteringViewItem, delta);
}
}
} else {
} else if (usingLinearNavigation) {
viewStacks.mountIntermediaryViews(id, leavingViewItem, delta);
}