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

Navigation issues with frames and pages with sideDrawer template #7194

Closed
delanick opened this issue May 2, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@delanick
Copy link

commented May 2, 2019

Hi,

I'm using {N} 5+ and using app.run() to start my project. Since you guys introduced the concept for sideDrawers, I can't seem to navigate to my login page without the sideDrawer being active. Can you please advise how I can render the the drawer unusable/inactive on my login page, or any page that shouldn't have it?

Or, how do I create a root frame, which navigates to an app-root (sideDrawer) frame if user logged in, or login page if not logged in, and the navigation between them? I'm currently reciving massive TypeErrors when trying to navigate between frames.

Or, please advise how I can navigate from one Frame to another if my sideDrawer has to be in app-root and my login page in another.

@tsonevn tsonevn added the question label May 3, 2019

@tsonevn

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

Hi @delanick,
In your case, you can define the RadSideDrawer as a root component and disable its gestures only for the needed pages(in your case your login page). Disabling the gesture will not allow the user to open the side drawer in the login page however, the navigation in the app will still work as expected.
For your convenience, I created a sample project which demonstrates the above-given suggestion. In the home page, I have disabled the drawer gesture. When you tap on the login button, the app will navigate to the browser page, where the drawer will be enabled.
Archive.zip

@NathanaelA

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

@delanick - if this is a NS-Core/PAN (Plain Awesome NativeScript) application -- I have an MUCH better way of doing this, imho. 😀

Created a blog post here http://fluentreports.com/blog/?p=732 to answer the question...

@delanick

This comment has been minimized.

Copy link
Author

commented May 3, 2019

@tsonevn Thanks so much, really appreciate it, will check it out now!

@NathanaelA This is a PSAN (Please Super-Awesome Nativescript) app :) Yeah, it's NS Core :)

Will check your blog post too :) Thanks!!

@delanick

This comment has been minimized.

Copy link
Author

commented May 3, 2019

@tsonevn Worked perfectly!
@NathanaelA So did yours.

Now the question begs: which approach will be better for the longer term? What is Nativescript's approach to this going forward for future versions?

Thanks guys, both responses are crazily appreciated!! :) I was going crazy!

@tsonevn

This comment has been minimized.

Copy link
Contributor

commented May 6, 2019

Hi @delanick,
I am glad to hear both suggestions(the one from @NathanaelA and mine) works for you. Regarding your question about the better one, In my opinion, it depends on the project and the structure, you are using in it. I would suggest checking, which approach will cost you less time to integrate the RadSideDrawer with the needed functionality if you are going to do that for an existing project or you can use our navigation-drawer template if you start a new project from scratch. About the second question, NativeScript will keep the support for RadSideDrawer as root and the functionality for disabling the swipe gesture for the future versions for sure.

@tsonevn tsonevn closed this May 6, 2019

@ghost ghost removed the question label May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.