{"action":"created","issue":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/161","labels_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/161/comments","events_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/161/events","html_url":"https://github.com/ramnathv/htmlwidgets/issues/161","id":112571389,"number":161,"title":"shiny conditionalPanel not resizing widget height","user":{"login":"jrowen","id":1530030,"avatar_url":"https://avatars.githubusercontent.com/u/1530030?v=3","gravatar_id":"","url":"https://api.github.com/users/jrowen","html_url":"https://github.com/jrowen","followers_url":"https://api.github.com/users/jrowen/followers","following_url":"https://api.github.com/users/jrowen/following{/other_user}","gists_url":"https://api.github.com/users/jrowen/gists{/gist_id}","starred_url":"https://api.github.com/users/jrowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrowen/subscriptions","organizations_url":"https://api.github.com/users/jrowen/orgs","repos_url":"https://api.github.com/users/jrowen/repos","events_url":"https://api.github.com/users/jrowen/events{/privacy}","received_events_url":"https://api.github.com/users/jrowen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T11:59:13Z","updated_at":"2015-10-21T14:05:13Z","closed_at":null,"body":"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.  \r\n\r\nI 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. \r\n```\r\nlibrary(shiny)\r\nlibrary(rhandsontable)\r\n\r\nserver <- function(input, output) {\r\n  output$tbl <- renderRHandsontable({\r\n    rhandsontable(data.frame(col1 = LETTERS[1:10], col2 = 1:10))\r\n  })\r\n}\r\n\r\nui <- shinyUI(fluidPage(\r\n  sidebarLayout(\r\n    sidebarPanel(\r\n      checkboxInput(\"check\", \"Show Table\", FALSE),\r\n      conditionalPanel(\"input.check === true\",\r\n                       rHandsontableOutput(\"tbl\"))\r\n    ),\r\n    mainPanel()\r\n  )\r\n))\r\n\r\nshinyApp(ui = ui, server = server)\r\n```"},"comment":{"url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/comments/149906470","html_url":"https://github.com/ramnathv/htmlwidgets/issues/161#issuecomment-149906470","issue_url":"https://api.github.com/repos/ramnathv/htmlwidgets/issues/161","id":149906470,"user":{"login":"ramnathv","id":346288,"avatar_url":"https://avatars.githubusercontent.com/u/346288?v=3","gravatar_id":"","url":"https://api.github.com/users/ramnathv","html_url":"https://github.com/ramnathv","followers_url":"https://api.github.com/users/ramnathv/followers","following_url":"https://api.github.com/users/ramnathv/following{/other_user}","gists_url":"https://api.github.com/users/ramnathv/gists{/gist_id}","starred_url":"https://api.github.com/users/ramnathv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramnathv/subscriptions","organizations_url":"https://api.github.com/users/ramnathv/orgs","repos_url":"https://api.github.com/users/ramnathv/repos","events_url":"https://api.github.com/users/ramnathv/events{/privacy}","received_events_url":"https://api.github.com/users/ramnathv/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T14:05:13Z","updated_at":"2015-10-21T14:05:13Z","body":"Setting an explicit height in `rHandsontableOutput` works. The trouble is that when the checkbox is FALSE by default, the conditional panel is hidden and so when the table is generated, it derives its height from the parent element, which turns out to be zero. Easiest way to see this is to set the default to TRUE and now everything works even without the height argument.\r\n\r\nSo, simple fix as indicated before is to do\r\n\r\n`rHandsontableOutput(\"tbl\", height = 300)`\r\n"}}