Skip to content

Rhandsontable dropdown functionality breaks in Shinytest2 browser (JS permissions policy violation) #416

@sawelch-NIVA

Description

@sawelch-NIVA

Hi, thanks as ever for the great package. I don't know how I managed without it.

I'm now trying to use Rhandsontable with dropdown options in a Shiny app (R 4.5.1, Shiny 1.11.0, Rhandsontable 0.3.8, Shinytest2 0.4.1). The table works fine in Chrome and Firefox, but when I try to record a test in the Shinytest2 browser session the dropdown cell fills stop working: specifically, I can open them, but not select an option or close them. I see there have been issues in Shinytest (not 2) about Rhandsontable cell validation failing, but nothing about dropdowns (though perhaps it's the same issue at root)?

I put together a minimal reprex:

library(shiny)
library(rhandsontable)

ui <- fluidPage(rHandsontableOutput("hot_table"))

server <- function(input, output, session) {
  output$hot_table <- renderRHandsontable({
    df <- data.frame(Status = "Active")
    rhandsontable(df, height = 300) %>%
      hot_col("Status", type = "dropdown", source = c("Active", "Inactive"))
  })
}

shinyApp(ui, server)

When I run use_shinytest2(); record_test() and then check the console in the Shinytest2 browser, I get the following error messages:

content.js:212 [Violation] Permissions policy violation: unload is not allowed in this document.
(anonymous) @ content.js:212Understand this error
VM98:130 Uncaught DataCloneError: Failed to execute 'postMessage' on 'Window': function customRenderer(instance, TD, row, col, prop, value, cellProperties) {
  if (['date', 'handsontable'...<omitted>...
       } could not be cloned.
at sendMessageToParent (eval at <anonymous> (shiny-testmode.ts:9:21), <anonymous>:130:21)
at sendInputEventToParent (eval at <anonymous> (shiny-testmode.ts:9:21), <anonymous>:134:9)
at HTMLDocument.eval (eval at <anonymous> (shiny-testmode.ts:9:21), <anonymous>:57:9)
at HTMLDocument.dispatch (jquery.js:5145:27)
at v.handle (jquery.js:4949:28)
at Object.trigger (jquery.js:8629:12)
at HTMLDocument.<anonymous> (jquery.js:8707:17)
at ce.each (jquery.js:383:19)
at ce.fn.init.each (jquery.js:205:17)
at ce.fn.init.trigger (jquery.js:8706:15)

Any insight into workarounds? It's by no means essential, but shinytest2 is so useful that I'd love to be able to get it to work with Rhandsontable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions