Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dateRangeInput in box obfuscates boxSidebar #139

Open
gacolitti opened this issue May 26, 2021 · 1 comment
Open

dateRangeInput in box obfuscates boxSidebar #139

gacolitti opened this issue May 26, 2021 · 1 comment

Comments

@gacolitti
Copy link

If a dateRangeInput is included in a box with a sidebar, then the dateRangeInput is shown on top of the sidebar. I would expect the sidebar to be on top of everything.

Here is a reproducible example:

if (interactive()) {
  library(shiny)
  library(shinydashboard)
  library(shinydashboardPlus)
  
  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      body = dashboardBody(
        box(
          title = "Update box sidebar", 
          closable = TRUE, 
          width = 12,
          height = "500px",
          solidHeader = FALSE, 
          collapsible = TRUE,
          actionButton("update", "Toggle card sidebar"),
          dateRangeInput(inputId = "date", "Date"),
          sidebar = boxSidebar(
            id = "mycardsidebar",
            p("Sidebar Content")
          )
        )
      ),
      sidebar = dashboardSidebar()
    ),
    server = function(input, output, session) {
      observe(print(input$mycardsidebar))
      
      observeEvent(input$update, {
        updateBoxSidebar("mycardsidebar")
      })
      
    }
  )
}
@gacolitti
Copy link
Author

I fixed this issue by adjusting the z-index for the sidebar:

if (interactive()) {
  library(shiny)
  library(shinydashboard)
  library(shinydashboardPlus)
  
  shinyApp(
    ui = tagList(
      tags$style(HTML(".direct-chat-contacts {z-index: 99 !important}")),
      dashboardPage(
      header = dashboardHeader(),
      body = dashboardBody(
        box(
          title = "Update box sidebar", 
          closable = TRUE, 
          width = 12,
          height = "500px",
          solidHeader = FALSE, 
          collapsible = TRUE,
          actionButton("update", "Toggle card sidebar"),
          dateRangeInput(inputId = "date", "Date"),
          sidebar = boxSidebar(
            id = "mycardsidebar",
            p("Sidebar Content")
          )
        )
      ),
      sidebar = dashboardSidebar()
    )),
    server = function(input, output, session) {
      observe(print(input$mycardsidebar))
      
      observeEvent(input$update, {
        updateBoxSidebar("mycardsidebar")
      })
      
    }
  )
}

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

No branches or pull requests

1 participant