Skip to content

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

Development

Successfully merging this pull request may close these issues.

selected = T doesn't work with dynamically generated menuItem or menuSubItem Sidebar menu with dynamic content does not show default tab

1 participant