Skip to content

shiny conditionalPanel not resizing widget height #161

@jrowen

Description

@jrowen

In the example below, the table does not appear when the checkbox is clicked. On the other hand, if the checkboxInput default value is set to TRUE, the table widget appears.

I think the problem is related to the resize when a conditionalPanel is involved. Using the code below, the rhandsontable.js resize function shows that the widget height is being set to 0 when the checkbox is checked.

library(shiny)
library(rhandsontable)

server <- function(input, output) {
  output$tbl <- renderRHandsontable({
    rhandsontable(data.frame(col1 = LETTERS[1:10], col2 = 1:10))
  })
}

ui <- shinyUI(fluidPage(
  sidebarLayout(
    sidebarPanel(
      checkboxInput("check", "Show Table", FALSE),
      conditionalPanel("input.check === true",
                       rHandsontableOutput("tbl"))
    ),
    mainPanel()
  )
))

shinyApp(ui = ui, server = server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions