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

Is it possible to add an argument to navbarPage that controls the default tabPanel selected? #970

Closed
ghost opened this issue Sep 26, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 26, 2015

Hi there,

Is it possible to add an argument to navbarPage that controls the default tabPanel selected?

Similar to that of selectInput(),
navbarPage(title, ..., id = NULL, selected = NULL)

Currently I'm using the code below to change the default tab, as I want the middle tabPanel selected when the app loads;
session$onFlush(function() {updateNavbarPage(session, "nav_tab_ids", selected = "middle_tab")})

However this is a little messy as you get a glimpse of the first tabPanel every time shiny flushes the reactive system.

I should just rearrange the tabs so that the middle tabPanel is the first tabPanel instead, but that would be too easy, and the app would lose some aesthetic appeal.

I may not be doing this in the most efficient way, if anyone has suggestions to different workarounds or advice it would be greatly appreciated, thanks!

p.s. Thanks so much for the awesome work with Shiny, it is an incredible product!!

@wch wch closed this as completed in 8470f7c Mar 30, 2016
wch added a commit that referenced this issue Mar 30, 2016
Allow setting selected item in navbarPage. Closes #970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants