title: handsontable in Shiny modal does not render properly
body: <p><strong>Problem</strong></p>
  
  <p>In my code I want to show a <code>rhandsontable</code> in a <code>modal</code>. When I first show the modal, the table is nicely rendered. However, when I close the modal and reopen it (without changing the underlying data), I only see parts of the table. Only after I clicked on the table, it renders again properly. If the data changes before re-opening the modal, the table is rendered again nicely.</p>
  
  <p><strong>Questions</strong></p>
  
  <p>How can I avoid that? Is there a <code>javascript</code> routine I can call to force the <code>handsontable</code> to re-render as a workaround?</p>
  
  <p><strong>Reprex</strong></p>
  
  <pre><code>library(shiny)
  library(rhandsontable)
  
  ui &lt;- fluidPage(actionButton("show", "show"), 
                  actionButton("change", "Change"))
  
  server &lt;- function(input, output, session) {
    dat &lt;- reactiveVal(data.frame(x = runif(2), 
                                  y = runif(2)))
  
    observeEvent(input$show, {
      showModal(modalDialog(rHandsontableOutput("hot")))
    })
  
    observeEvent(input$change, dat(data.frame(x = runif(2), 
                                              y = runif(2))))
  
    output$hot &lt;- renderRHandsontable(rhandsontable(dat()))
  }
  </code></pre>
  
  <p><strong>How to reproduce the error</strong></p>
  
  <ol>
  <li>Open the modal and close it</li>
  <li>Re-open the modal and you will see that it is nor rendered properly</li>
  <li>Close again and refresh the data </li>
  <li>Re-open the modal and see that it is rendered properly again</li>
  </ol>
  
  <p><strong>Screenshots</strong></p>
  
  <p><a href="https://i.stack.imgur.com/9SO29.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9SO29.png" alt="handsontable rendered properly"></a>
  <a href="https://i.stack.imgur.com/41xDL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/41xDL.png" alt="handsontable not rendered properly"></a></p>
  
  <p><strong>Environment</strong></p>
  
  <pre><code>R version 3.5.0 (2018-04-23)
  Platform: i386-w64-mingw32/i386 (32-bit)
  Running under: Windows 7 (build 7601) Service Pack 1
  
  Matrix products: default
  
  locale:
  [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
  [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
  [5] LC_TIME=German_Germany.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] shiny_1.1.0         rhandsontable_0.3.6
  
  loaded via a namespace (and not attached):
   [1] Rcpp_0.12.17    digest_0.6.15   later_0.7.2     mime_0.5       
   [5] R6_2.2.2        xtable_1.8-2    jsonlite_1.5    magrittr_1.5   
   [9] rlang_0.2.1     promises_1.0.1  tools_3.5.0     htmlwidgets_1.2
  [13] httpuv_1.4.3    yaml_2.1.19     compiler_3.5.0  htmltools_0.3.6
  </code></pre>
  
  <p><em>Browser tested: Chrome Version 69.0.3497.100, IE 11</em></p>