-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Issue Description
If two pages have a RootLayout element, then after backward navigation from the second page to the first page, an error will occur when trying to access the RootLayout (e.g. call getRootLayout()).
This is because RootLayout class called on the second page overwrites the global variable:
global.rootLayout = this;
So RootLayout of the first page "becomes" undefined.
Workaround (code for the first page):
export function navigatedTo(data: NavigatedData) {
const page = <Page>data.object;
if (data.isBackNavigation) {
global.rootLayout = <RootLayout>page.getViewById('firstPageRootLayout');
}
}
Reproduction
No response
Relevant log output (if applicable)
No response
Environment
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct