DillonHammill / DataEditR

An Interactive R Package for Viewing, Entering Filtering and Editing Data
https://dillonhammill.github.io/DataEditR/
384 stars 40 forks source link

Bug if used within a model #25

Closed lgirola closed 3 years ago

lgirola commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

Hi Dillon, I tried reposting it correctly this time. I'm not sure I did it right, I'm new to github

Thanks, Lou -- Sent with Tutanota, the secure & ad-free mailbox.

Jul 24, 2021, 11:14 by @.***:

@lgirola https://github.com/lgirola> , this is a known rhandsontable issue (> #24 https://github.com/DillonHammill/DataEditR/issues/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.

— You are receiving this because you were mentioned. Reply to this email directly, > view it on GitHub https://github.com/DillonHammill/DataEditR/issues/25#issuecomment-886025281> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AUEZ552DIJWU2SOW7PY3YMLTZJ75RANCNFSM5A5I5IBQ> .

DillonHammill commented 3 years ago

Thanks!