As there was a related issue in the rhandsontable github I also submitted this there (https://github.com/jrowen/rhandsontable/issues/260#issuecomment-424717589), but I'm not sure whether it's something to do with rhandsontable, or how modals work in Shiny, or...more likely.... my setup ¯_(ツ)_/¯
The problem is when rhandsontable is within a modal dialog the right-click context menu is not displayed.
Reprex below:
library(shiny)
library(rhandsontable)
hierMetaOutput <- function(id) {
ns <- NS(id)
tagList(
rHandsontableOutput(ns("metaTable"))
)
}
hierMeta <- function(input, output, session, sampleIDs) {
output$metaTable <- rhandsontable::renderRHandsontable({
currentlyLoadedSamples <- data.frame(Strain_ID = sampleIDs,
`Property 1` = rep("", length(sampleIDs)))
rhandsontable::rhandsontable(currentlyLoadedSamples)
})
}
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
IDBacApp::hierMetaOutput("datae")
),
mainPanel(
actionButton("popup", "Click Me"),
plotOutput("distPlot")
)
)
)
server <- function(input, output) {
yep <- callModule(IDBacApp::hierMeta, "datae", sampleIDs = letters[1:5])
datafile <- callModule(IDBacApp::hierMeta, "datafile",sampleIDs = letters[1:5])
observeEvent(input$popup, {
showModal(modalDialog(IDBacApp::hierMetaOutput("datafile"),
size="l"))
})
}
shinyApp(ui = ui, server = server)