Skip to content

boxPlus() clashes with enable_preloader #51

Closed

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 })
  }
)

Activity

  1. DivadNojnarg commented on Oct 3, 2019

    @DivadNojnarg
    Member

    Do you still have the issue. I don't manage to reproduce it

  2. leungi commented on Oct 6, 2019

    @leungi
    Author

    Attached is screencast showing the behaviour when sidebar_start_open = TRUE - the box shows up while loader splash screen is active on app start up.

    dashboardPlus_issue

  3. leungi commented on Oct 7, 2019

    @leungi
    Author

    Thanks for the update 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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