Open abby-pfingsten opened 2 years ago
You will need to create a minimal reproducible example, because there's not enough information here to debug your issue. For the record, here's a minimal example showing that an actionButton
in a module can trigger code in an observer, within a module:
library(shiny)
mod1_ui <- function(id) {
ns <- NS(id)
tagList(
modalDialog(
actionButton(ns("btn"), "Test")
)
)
}
mod1_server <- function(id) {
moduleServer(id, function(input, output, session) {
observeEvent(input$btn, {
message("btn hit")
})
})
}
ui <- fluidPage(
mod1_ui("mod1")
)
server <- function(input, output, session) {
mod1_server("mod1")
}
shinyApp(ui, server)
selectInput
where one of the options is supposed to trigger anotherselectInput
to appear, based on aconditionalPanel
. Maybe this is a modal issue, and not a specificactionButton
orselectInput
issue...?I have this big app that is modularized - two of the tabs have a very similar structure wherein there is a datatable that is displayed, and the last column you are able to click which populates a modal. In the modal, you are able to select some stuff, and there is an
actionButton
to trigger saving some responses to a database. In tab 1, everything is working exactly as expected. In tab 2, everything WAS working at some point, but for a reason I cannot figure out, theactionButton
stopped being triggered altogether, despite no direct changes having been made to this part of the code.This is the part of the code which produces the modal (which is exactly the same as it is in tab 1, where it is working):
` modalDialog(
)`
This is the part of the code which SHOULD be triggered when you click "Assign", but it is not. The browser is never triggered:
`observeEvent(input$submit_assignment, {
. . .
})`
I'm running R version 3.6.0.