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

Bug if used within a model #25

Closed
lgirola opened this issue Jul 24, 2021 · 3 comments
Closed

Bug if used within a model #25

lgirola opened this issue Jul 24, 2021 · 3 comments

Comments

@lgirola
Copy link

lgirola commented Jul 24, 2021

Hi, rhandsontable is very useful for the types of models I work with. And in combination with modal dialogue, it makes the model input process very user friendly.

However, when an rhandsontable is rendered in a modal box, depending on the circumstance only a part of the table is rendered until the user clicks on the partially rendered table. Is this a bug, or am I using rhandsontable incorrectly? Please see super simple MWE code below. It renders the initial table just fine, but when the user makes a change to the table (for example inserting a row with data) and tries re-rendering it by clicking the "Show" action button, only part of the table is rendered until the user clicks on the table.

The first image shows the rendered table when first invoking the app - looks good. The second image shows the rendered table after having inserted a row/data and then clicking "Show" -- I only get a partial rendering of the table until clicking on it, and then the complete table pops up (as it should have done after the "Show" click). The third images shows the completely and correctly rendered table after inserting a 3rd row, after clicking "Show", and after clicking on the partially rendered table.

library(shiny)
library(rhandsontable)

ui <- fluidPage(actionButton("show","Show"), 
                actionButton("reset","Reset"))

server <- function(input,output,session){

  dat <- reactiveVal(data.frame(x=runif(2),y=runif(2)))
  
  observeEvent(input$show,{showModal(modalDialog(rHandsontableOutput("hot")))})
  
  observeEvent(input$reset,dat(data.frame(x=runif(2),y=runif(2))))
  
  output$hot <- renderRHandsontable(rhandsontable(dat()))

  } # close Server

shinyApp(ui,server)

Image1
Image2
Image3

@DillonHammill
Copy link
Owner

DillonHammill commented Jul 24, 2021

@lgirola, this is a known rhandsontable issue (#24). Please post your issue there https://github.com/jrowen/rhandsontable/issues as there is nothing I can do from the DataEditR side of things to fix this. Any updates will be posted to #24.

@lgirola
Copy link
Author

lgirola commented Jul 24, 2021 via email

@DillonHammill
Copy link
Owner

Thanks!

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

2 participants