Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$navigateTo nested Frame does show nothing #366

Closed
wendt88 opened this issue Oct 25, 2018 · 7 comments
Closed

$navigateTo nested Frame does show nothing #366

wendt88 opened this issue Oct 25, 2018 · 7 comments
Labels
priority:normal V2 Issues related to V2

Comments

@wendt88
Copy link

wendt88 commented Oct 25, 2018

Version

2.0.2

Reproduction link

Playground

Platform and OS info

Android

Steps to reproduce

click at one of theses buttons in playground

What is expected?

that above opens one of the contents
1 -> Hello world text content
2 -> Image

What is actually happening?

Components get rendered (watch console),
but nothing gets shown
looking the elements on chrome in debug mode, there is only a Frame text:

frame

@rigor789
Copy link
Member

I can't see buttons in the linked playground, can you check if you linked the correct one?

As a side note, I'm not sure if nested frames are supported in NativeScript, can't find much info on that...

@wendt88
Copy link
Author

wendt88 commented Oct 26, 2018

Sorry, I updated now my link in the original post.
the only thing I could find on these was:
#213
and watching the code there is a frame option for the $navigateTo method.
looking to console the components gets initialized and also the history works

@wendt88
Copy link
Author

wendt88 commented Oct 26, 2018

Now I get it work by wrapping my content in a <Page>.
In my case I have a sidedrawer wich navigates the frame inside mainContent.
I navigate always to the same content passing various pageId's as a property.
Navigating works, but if I go back, no Vue-Lifecycle-Hook gets triggered, so from my base component (containing the sidedrawer) doesn't know on which page (pageId) the user is.
as a workaround I navigate normaly from basecomponent to same basecomponent passing the pageId, which I pass to his subcomponent (the content)
the only thing is, that so my basecomponent containing the sidedrawer gets rerendered every time

@rigor789
Copy link
Member

rigor789 commented Nov 1, 2018

Back navigation doesn't actually trigger any Vue lifecycle events, as the instance in the backstack is not destroyed. Instances in the backstack are only destroyed when using clearHistory: true or navigating from an entry with backstackVisible: false.

Can you share what you need the lifecycle events for? Can you use navigated and navigatedBack events on the <Frame> instead?

I'm not sure if we have these documented, but you can see when they are emitted here:

this.$emit('navigated', entry)
})
const handler = args => {
if (args.isBackNavigation) {
page.off('navigatedFrom', handler)
this.$emit('navigatedBack', entry)

@pdipax
Copy link

pdipax commented Nov 5, 2018

Your code it's ok but you must add the page tag on your pages Content1 and Content2

Playground

<Page actionBarHidden="true">
...
</Page>

@wendt88
Copy link
Author

wendt88 commented Nov 8, 2018

the navigated and navigatedBack events solved my problem... there I have access to the props, thx!

@slushnys
Copy link

slushnys commented Nov 9, 2018

May I ask why you need navigation within the same component (that is if I understood the problem correctly)? You were saying you use this as a workaround, maybe vuex would be of a value for you here?

@rigor789 rigor789 added the V2 Issues related to V2 label Dec 5, 2022
@rigor789 rigor789 closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:normal V2 Issues related to V2
Development

No branches or pull requests

5 participants