Why are the treeInput expanders disappearing?

37 views Asked by At

This is reproducible:

Expand 'Filter'

Expand 'Solutions'

Expand 'Sectors'

Expand 'Solutions'

and now the carets that control the treeInput are gone. Is this a bug in shinyDashboard or treeInput or what?

library(shinydashboard);
library(shinydashboardPlus);
library(shinyWidgets);
library(fresh);

my_theme = create_theme(
  adminlte_color(
    light_blue = "#A7A7A7"
  ),
  adminlte_sidebar(width=420)
)

thepast = paste0(as.character(as.integer(format(Sys.Date(), "%Y"))-2),"-")
lastyear = as.character(as.integer(format(Sys.Date(), "%Y"))-1)
thisyear = as.character(as.integer(format(Sys.Date(), "%Y")))
nextyear = as.character(as.integer(format(Sys.Date(), "%Y"))+1)
nextyear2 = as.character(as.integer(format(Sys.Date(), "%Y"))+2)
future = paste0(as.character(as.integer(format(Sys.Date(), "%Y"))+3),"+")

sidebar = dashboardSidebar(
  width="420",
  sidebarMenu(
    menuItem("Filter", icon=icon("filter"),
             menuItem("Sectors",
                       strong("Congestion"),
                       checkboxInput("showCongestion_checkbox", "Show Congestion", value = TRUE, width = NULL)#,
             ),
             menuItem("Solutions",
                      splitLayout(
                        cellWidths=c("50%","50%"),
                        treeInput(
                          inputId = "solutionStatusFiltersCheckbox",
                          label = "Project Status",
                          choices = create_tree(
                            data.frame(
                              "All" = c("All"),
                              "Status" = c("Active" , "Completed" , "On-Hold" , "Pending" , "Canceled" , "Deleted" , "Inactive"),
                              "Category" = c("ACTIVE", "COMPLETED", "ON_HOLD", "PENDING" , "CANCELED" , "DELETED" , "INACTIVE" )
                            ),
                            levels = c("All","Status"),
                            levels_id = c("All","Category")
                          ),
                         
                          selected = c("ACTIVE", "COMPLETED", "ON_HOLD", "PENDING"),
                          returnValue = "id",
                          closeDepth = 0
                        ),                      
                        treeInput(
                          inputId = "solutionMilestoneFiltersCheckbox",
                          label = "Milestones Completed",
                          choices = create_tree(
                            data.frame(
                              "All" = c("All"),
                              "Status" = c("On Air" , "Const Complete" , "REC" , "Cand Select" , "NPP Release" , "Pre NPP Rel" ),
                              "Category" = c("On Air", "Construction Completed", "Real Estate Completed", "Candidate Selected" , "Pl Release" , "No Milestones" )
                            ),
                            levels = c("All","Status"),
                            levels_id = c("All","Category")
                          ),
                         
                          selected = c("All"),
                          returnValue = "id",
                          closeDepth = 0
                        )                      
                      ),
                      hr(),
                      splitLayout(
                        cellWidths=c("33%","33%","33%"),
                        treeInput(
                          inputId = "solutionBPYFiltersCheckbox",
                          label = "BPY",
                          choices = create_tree(
                            data.frame(
                              "All" = c("All"),
                              "Years" = c( "0", thepast, lastyear, thisyear, nextyear, nextyear2, future ),
                              "Category" = c("UNCLASSIFIED", "PAST", "LAST_YEAR", "THIS_YEAR", "NEXT_YEAR","NEXT2_YEAR","FUTURE")
                            ),
                            levels = c("All","Years"),
                            levels_id = c("All","Category")
                          ),
                         
                          selected = c("All"),
                          returnValue = "id",
                          closeDepth = 0
                        ),                      
                        treeInput(
                          inputId = "solutionPORFiltersCheckbox",
                          label = "POR",
                          choices = create_tree(
                            data.frame(
                              "All" = c("All"),
                              "Years" = c( "0", thepast, lastyear, thisyear, nextyear, nextyear2, future ),
                              "Category" = c("UNCLASSIFIED", "PAST", "LAST_YEAR", "THIS_YEAR", "NEXT_YEAR","NEXT2_YEAR","FUTURE")
                            ),
                            levels = c("All","Years"),
                            levels_id = c("All","Category")
                          ),
                          selected = c("All"),
                          returnValue = "id",
                          closeDepth = 0
                        ),                      
                        treeInput(
                          inputId = "solutionROAFiltersCheckbox",
                          label = "Req On Air",
                          choices = create_tree(
                            data.frame(
                              "All" = c("All"),
                              "Years" = c( "0", thepast, lastyear, thisyear, nextyear, nextyear2, future ),
                              "Category" = c("UNCLASSIFIED", "PAST", "LAST_YEAR", "THIS_YEAR", "NEXT_YEAR","NEXT2_YEAR","FUTURE")
                            ),
                            levels = c("All","Years"),
                            levels_id = c("All","Category")
                          ),
                          selected = c("All"),
                          returnValue = "id",
                          closeDepth = 0
                        ),                      
                      )
             )
    )
  )
)
body = dashboardBody(
  use_theme(my_theme),
)

# Define UI for application that draws a histogram
ui <- dashboardPage(
  dashboardHeader(titleWidth = 420 , title = "Disappearing expanders"),
  sidebar,
  body
)

# Define server logic required to draw a histogram
server <- function(input, output) {

}

# Run the application
shinyApp(ui = ui, server = server)
0

There are 0 answers