nativescript-vue / nativescript-vue-navigator

A simple router for NativeScript-Vue, built on top of $navigateTo to simplify routing from within components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

navigateBack fails when using 2 frames

hgc2002 opened this issue · comments

After navigating on frame1, several pages and then frame2 and some pages, when I execute "back" on navigation bar, the app shows the last page shown at the first frame (frame1) instead of the last page of the last (current) frame (frame2).

I'm using NS + VUE to show several pages in a general frame and then the rest in a child frame using RadSideDrawer.

Example: frame1 -> page1 -> page2 -> frame2 -> page3 -> page4 -> back -> page2 !!!
The correct path should be ending in page3.

This is App.vue template:

<template>
    <Frame class="frame">
        <Page actionBarHidden="true" class="init">
            <StackLayout @tap="gotoLogin">
                <Image row="1" col="1" src="~/assets/image/image.jpg" class="logo" />
                <Label row="2" col="1" :text="app_version" class="version" />
                <Label row="3" col="1" text="Acceder" class="continuar" />
            </StackLayout>
        </Page>        
    </Frame>
</template>

After couple of pages, that drives to the drawer menu (NavBase):

<template>
    <Page actionBarHidden="true" class="page" >
        <RadSideDrawer ref="drawer" drawerLocation="Right" >
            <DrawerMenu ~drawerContent class="drawer-content" />
            <NavSkeleton ~mainContent />
        </RadSideDrawer>
    </Page>
</template>

And here is the second frame defined (NavSkeleton):

<template>
    <GridLayout class="App" rows="*, auto">  
        <Frame id="contentframe">
            <Page actionBarHidden="true"> 
                <ContentView row="0">
                      <Navigator defaultRoute="/home"/>
                </ContentView>
            </Page>
        </Frame>

        <NavBar row="1"/>
    </GridLayout>                
</template>

Navigator comes from nativescript-vue-navigator plugin.

Thanks for your help.

Regards.

Version info:

Android 8.0 API 26
tns: 6.2.2
tns-core-modules@6.3.1
tns-ios: 6.2.0
nativescript-vue-navigator: 0.2.0

Finally I couldn't make it to work, so I stopped using RadSideDrawer and two frames: just the default frame and changed the drawer menu to a modal page. Now everything works smoothly.

We landed support for multiple Navigators. I believe it covers the use case in the original issue.