Skip to content

boxPlus() clashes with enable_preloader #51

@leungi

Description

@leungi

Reproducible code below.

Expected: regardless of value of sidebar_start_open argument in boxPlus(), nothing shows up on loading screen when enable_preloader = TRUE.

Outcome: sidebar_start_open must be FALSE when enable_preloader = TRUE to get above expected result.

## example with boxPlus sidebar showing up on load
library(shiny)
library(shinydashboard)
library(shinyWidgets)
library(leaflet)

map <- leaflet() %>% addTiles()

shinyApp(
  ui = dashboardPagePlus(
    enable_preloader = TRUE,
    dashboardHeaderPlus(),
    dashboardSidebar(),
    dashboardBody(
      setShadow("box"),
      fluidRow(
        boxPlus(
          title = "Closable Box with dropdown", 
          closable = TRUE, 
          status = "warning", 
          solidHeader = FALSE, 
          collapsible = TRUE,
          enable_sidebar = TRUE,
          sidebar_width = 25,
          sidebar_start_open = TRUE,
          sidebar_content = tagList(
            checkboxInput("somevalue", "Some value", FALSE),
            verbatimTextOutput("value")
          ),
          map
        )
      )
    )
  ),
  server = function(input, output) {
    output$value <- renderText({ input$somevalue })
  }
)
## example with boxPlus sidebar hidden on load
library(shiny)
library(shinydashboard)
library(shinyWidgets)
library(leaflet)

map <- leaflet() %>% addTiles()

shinyApp(
  ui = dashboardPagePlus(
    enable_preloader = TRUE,
    dashboardHeaderPlus(),
    dashboardSidebar(),
    dashboardBody(
      setShadow("box"),
      fluidRow(
        boxPlus(
          title = "Closable Box with dropdown", 
          closable = TRUE, 
          status = "warning", 
          solidHeader = FALSE, 
          collapsible = TRUE,
          enable_sidebar = TRUE,
          sidebar_width = 25,
          sidebar_start_open = FALSE,
          sidebar_content = tagList(
            checkboxInput("somevalue", "Some value", FALSE),
            verbatimTextOutput("value")
          ),
          map
        )
      )
    )
  ),
  server = function(input, output) {
    output$value <- renderText({ input$somevalue })
  }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions