You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, in 0.6.0, selected = TRUE in a menuItem() does not trigger the corresponding conditionalPanel(). (If you leave that out though, everything works fine - see example below).
No repro for < 0.6.0.
Repro
This works as expected:
library(shinydashboard)
library(shiny)
ui<- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarMenu(id="tabs",
menuItem("tab1", tabName="tab1"),
menuItem("tab2", tabName="tab2")
),
conditionalPanel("input.tabs == 'tab1'",
"This does should appear on startup"
)
),
dashboardBody()
)
server<-function(input, output, session){}
shinyApp(ui, server)
This should result in exactly the same app, but it gets messed up:
* Fixes#214: make sure that the `data-value` attribute of `.sidebarMenuSelectedTabItem` is always set in the body of the `ensureActivatedTab()` function
* update NEWS
* re-organize code following a more logical structure
From: https://stackoverflow.com/questions/44172064/shinydashboard-is-not-showing-item-properly-in-sidebar
For some reason, in 0.6.0,
selected = TRUE
in amenuItem()
does not trigger the correspondingconditionalPanel()
. (If you leave that out though, everything works fine - see example below).No repro for < 0.6.0.
Repro
This works as expected:
This should result in exactly the same app, but it gets messed up:
Workaround
Use a dynamic sidebar menu:
The text was updated successfully, but these errors were encountered: