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

detect and enforce selected tab for dynamic sidebars #189

Closed
wants to merge 2 commits into from

Conversation

bborgesr
Copy link
Contributor

@bborgesr bborgesr commented Feb 24, 2017

This is very simple fix, just running ensureActivatedTab() after renderMenu (renderValue method) is called. This allows for the correct tab to be selected for dynamic sidebars (closes #87, closes #71)

Here's an example app, from #71:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Dynamic sidebar"),
  dashboardSidebar(
    sidebarMenuOutput("menu")
  ),
  dashboardBody(tabItems(
    tabItem(tabName = "dashboard", h2("Dashboard tab content"))
  ))
)

server <- function(input, output) {
  output$menu <- renderMenu({
    sidebarMenu(id="mytabs",
      menuItem("Menu item", tabName="dashboard", icon = icon("calendar"))
    )
  })
}

shinyApp(ui, server)

…led. This allows for the correct tab to be selected for dynamic sidebars (closes #87, closes #71)
@bborgesr bborgesr self-assigned this Feb 24, 2017
@bborgesr
Copy link
Contributor Author

closing in favor of #199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant